Fix tests and build.

This commit is contained in:
Nikolai Kochetov 2020-10-15 14:52:25 +03:00
parent d0112c5dc4
commit ee7b32c283
3 changed files with 21 additions and 21 deletions

View File

@ -17,7 +17,7 @@ private:
mutable std::atomic<size_t> columns_number{0};
public:
static constexpr auto name = "columnsNumber";
static constexpr auto name = "blockNumber";
static FunctionPtr create(const Context &)
{
return std::make_shared<FunctionBlockNumber>();

View File

@ -49,28 +49,28 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
void executeImpl(ColumnsWithTypeAndName & columns, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
if (!(executeType<UInt8>(block, arguments, result)
|| executeType<UInt16>(block, arguments, result)
|| executeType<UInt32>(block, arguments, result)
|| executeType<UInt64>(block, arguments, result)
|| executeType<Int8>(block, arguments, result)
|| executeType<Int16>(block, arguments, result)
|| executeType<Int32>(block, arguments, result)
|| executeType<Int64>(block, arguments, result)
|| executeType<Float32>(block, arguments, result)
|| executeType<Float64>(block, arguments, result)))
throw Exception("Illegal column " + block[arguments[0]].column->getName()
+ " of argument of function " + getName(),
if (!(executeType<UInt8>(columns, arguments, result)
|| executeType<UInt16>(columns, arguments, result)
|| executeType<UInt32>(columns, arguments, result)
|| executeType<UInt64>(columns, arguments, result)
|| executeType<Int8>(columns, arguments, result)
|| executeType<Int16>(columns, arguments, result)
|| executeType<Int32>(columns, arguments, result)
|| executeType<Int64>(columns, arguments, result)
|| executeType<Float32>(columns, arguments, result)
|| executeType<Float64>(columns, arguments, result)))
throw Exception("Illegal column " + columns[arguments[0]].column->getName()
+ " of argument of function " + getName(),
ErrorCodes::ILLEGAL_COLUMN);
}
private:
template <typename T>
bool executeType(Block & block, const ColumnNumbers & arguments, size_t result) const
bool executeType(ColumnsWithTypeAndName & columns, const ColumnNumbers & arguments, size_t result) const
{
if (const ColumnVector<T> * col_from = checkAndGetColumn<ColumnVector<T>>(block[arguments[0]].column.get()))
if (const ColumnVector<T> * col_from = checkAndGetColumn<ColumnVector<T>>(columns[arguments[0]].column.get()))
{
auto col_to = ColumnString::create();
@ -91,7 +91,7 @@ private:
}
buf_to.finalize();
block[result].column = std::move(col_to);
columns[result].column = std::move(col_to);
return true;
}

View File

@ -89,12 +89,12 @@ public:
Years
};
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
void executeImpl(ColumnsWithTypeAndName & columns, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
StringRef maximum_unit_str;
if (arguments.size() == 2)
{
const ColumnPtr & maximum_unit_column = block[arguments[1]].column;
const ColumnPtr & maximum_unit_column = columns[arguments[1]].column;
const ColumnConst * maximum_unit_const_col = checkAndGetColumnConstStringOrFixedString(maximum_unit_column.get());
if (maximum_unit_const_col)
maximum_unit_str = maximum_unit_const_col->getDataColumn().getDataAt(0);
@ -132,7 +132,7 @@ public:
for (size_t i = 0; i < input_rows_count; ++i)
{
/// Virtual call is Ok (neglible comparing to the rest of calculations).
Float64 value = block[arguments[0]].column->getFloat64(i);
Float64 value = columns[arguments[0]].column->getFloat64(i);
bool is_negative = value < 0;
if (is_negative)
@ -159,7 +159,7 @@ public:
}
buf_to.finalize();
block[result].column = std::move(col_to);
columns[result].column = std::move(col_to);
}
static void processUnit(