dbms: improvements [#METR-19266]

This commit is contained in:
Alexey Arno 2016-08-11 00:15:51 +03:00
parent f5d9d0ebc9
commit 42cb1f690c
6 changed files with 26 additions and 26 deletions

View File

@ -322,12 +322,12 @@ public:
IArraySources<TResult> sources = createSources(block, args, branches);
ArraySink<TResult> sink = createSink(block, sources, result, row_count);
ColumnUInt64 * tracker_col = nullptr;
ColumnUInt16 * tracker_col = nullptr;
if (tracker != result)
{
auto & col = block.unsafeGetByPosition(tracker).column;
col = std::make_shared<ColumnUInt64>(row_count);
tracker_col = static_cast<ColumnUInt64 *>(col.get());
col = std::make_shared<ColumnUInt16>(row_count);
tracker_col = static_cast<ColumnUInt16 *>(col.get());
}
for (size_t cur_row = 0; cur_row < row_count; ++cur_row)

View File

@ -148,12 +148,12 @@ public:
size_t row_count = conds[0].getSize();
PaddedPODArray<TResult> & res = createSink(block, result, row_count);
ColumnUInt64 * tracker_col = nullptr;
ColumnUInt16 * tracker_col = nullptr;
if (tracker != result)
{
auto & col = block.unsafeGetByPosition(tracker).column;
col = std::make_shared<ColumnUInt64>(row_count);
tracker_col = static_cast<ColumnUInt64 *>(col.get());
col = std::make_shared<ColumnUInt16>(row_count);
tracker_col = static_cast<ColumnUInt16 *>(col.get());
}
for (size_t cur_row = 0; cur_row < row_count; ++cur_row)

View File

@ -348,25 +348,25 @@ size_t ColumnNullable::byteSize() const
void ColumnNullable::getExtremes(Field & min, Field & max) const
{
if (auto col = typeid_cast<ColumnInt8 *>(&*nested_column))
if (auto col = typeid_cast<ColumnInt8 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnInt16 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnInt16 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnInt32 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnInt32 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnInt64 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnInt64 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnUInt8 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnUInt8 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnUInt16 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnUInt16 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnUInt32 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnUInt32 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnUInt64 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnUInt64 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnFloat32 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnFloat32 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else if (auto col = typeid_cast<ColumnFloat64 *>(&*nested_column))
else if (auto col = typeid_cast<ColumnFloat64 *>(nested_column.get()))
col->getExtremesFromNullableContent(min, max, &getNullMapContent().getData());
else
nested_column.get()->getExtremes(min, max);

View File

@ -403,12 +403,12 @@ bool StringArrayEvaluator::perform(Block & block, const ColumnNumbers & args, si
size_t row_count = conds[0].getSize();
VarStringArraySink sink = createSink(block, sources, result, row_count);
ColumnUInt64 * tracker_col = nullptr;
ColumnUInt16 * tracker_col = nullptr;
if (tracker != result)
{
auto & col = block.unsafeGetByPosition(tracker).column;
col = std::make_shared<ColumnUInt64>(row_count);
tracker_col = static_cast<ColumnUInt64 *>(col.get());
col = std::make_shared<ColumnUInt16>(row_count);
tracker_col = static_cast<ColumnUInt16 *>(col.get());
}
for (size_t cur_row = 0; cur_row < row_count; ++cur_row)

View File

@ -439,12 +439,12 @@ public:
static void execute(Block & block, const StringSources & sources, const CondSources & conds,
SinkType & sink, size_t row_count, size_t result, size_t tracker)
{
ColumnUInt64 * tracker_col = nullptr;
ColumnUInt16 * tracker_col = nullptr;
if (tracker != result)
{
auto & col = block.unsafeGetByPosition(tracker).column;
col = std::make_shared<ColumnUInt64>(row_count);
tracker_col = static_cast<ColumnUInt64 *>(col.get());
col = std::make_shared<ColumnUInt16>(row_count);
tracker_col = static_cast<ColumnUInt16 *>(col.get());
}
for (size_t cur_row = 0; cur_row < row_count; ++cur_row)

View File

@ -160,7 +160,7 @@ void FunctionMultiIf::executeImpl(Block & block, const ColumnNumbers & args, siz
/// Append a column that tracks, for each result of multiIf, the index
/// of the originating column.
ColumnWithTypeAndName elem;
elem.type = std::make_shared<DataTypeUInt64>();
elem.type = std::make_shared<DataTypeUInt16>();
size_t tracker = non_nullable_block.columns();
non_nullable_block.insert(elem);
@ -190,7 +190,7 @@ void FunctionMultiIf::executeImpl(Block & block, const ColumnNumbers & args, siz
return col.isNullable() && static_cast<const ColumnNullable &>(col).isNullAt(row);
};
if (auto col = typeid_cast<ColumnConstUInt64 *>(tracker_holder.get()))
if (auto col = typeid_cast<ColumnConstUInt16 *>(tracker_holder.get()))
{
auto pos = col->getData();
const IColumn & origin = *block.unsafeGetByPosition(pos).column;
@ -209,7 +209,7 @@ void FunctionMultiIf::executeImpl(Block & block, const ColumnNumbers & args, siz
nullable_col.getNullValuesByteMap() = null_map;
}
else if (auto col = typeid_cast<ColumnUInt64 *>(tracker_holder.get()))
else if (auto col = typeid_cast<ColumnUInt16 *>(tracker_holder.get()))
{
auto null_map = std::make_shared<ColumnUInt8>(row_count);
nullable_col.getNullValuesByteMap() = null_map;
@ -485,7 +485,7 @@ bool FunctionMultiIf::performTrivialCase(Block & block, const ColumnNumbers & ar
if (tracker != result)
{
ColumnPtr & col = block.getByPosition(tracker).column;
col = std::make_shared<ColumnConstUInt64>(row_count, index);
col = std::make_shared<ColumnConstUInt16>(row_count, index);
}
};