From ee7b32c2837e1ccbc4e04c7107d2962b2d1bdbfd Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Thu, 15 Oct 2020 14:52:25 +0300 Subject: [PATCH] Fix tests and build. --- src/Functions/blockNumber.cpp | 2 +- src/Functions/formatReadable.h | 32 +++++++++++------------ src/Functions/formatReadableTimeDelta.cpp | 8 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Functions/blockNumber.cpp b/src/Functions/blockNumber.cpp index eb5f4d88ee4..c5b0b57db0b 100644 --- a/src/Functions/blockNumber.cpp +++ b/src/Functions/blockNumber.cpp @@ -17,7 +17,7 @@ private: mutable std::atomic columns_number{0}; public: - static constexpr auto name = "columnsNumber"; + static constexpr auto name = "blockNumber"; static FunctionPtr create(const Context &) { return std::make_shared(); diff --git a/src/Functions/formatReadable.h b/src/Functions/formatReadable.h index 1e2c833b91e..282a560dd62 100644 --- a/src/Functions/formatReadable.h +++ b/src/Functions/formatReadable.h @@ -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(block, arguments, result) - || executeType(block, arguments, result) - || executeType(block, arguments, result) - || executeType(block, arguments, result) - || executeType(block, arguments, result) - || executeType(block, arguments, result) - || executeType(block, arguments, result) - || executeType(block, arguments, result) - || executeType(block, arguments, result) - || executeType(block, arguments, result))) - throw Exception("Illegal column " + block[arguments[0]].column->getName() - + " of argument of function " + getName(), + if (!(executeType(columns, arguments, result) + || executeType(columns, arguments, result) + || executeType(columns, arguments, result) + || executeType(columns, arguments, result) + || executeType(columns, arguments, result) + || executeType(columns, arguments, result) + || executeType(columns, arguments, result) + || executeType(columns, arguments, result) + || executeType(columns, arguments, result) + || executeType(columns, arguments, result))) + throw Exception("Illegal column " + columns[arguments[0]].column->getName() + + " of argument of function " + getName(), ErrorCodes::ILLEGAL_COLUMN); } private: template - 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 * col_from = checkAndGetColumn>(block[arguments[0]].column.get())) + if (const ColumnVector * col_from = checkAndGetColumn>(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; } diff --git a/src/Functions/formatReadableTimeDelta.cpp b/src/Functions/formatReadableTimeDelta.cpp index 01fe0913f7c..21003816960 100644 --- a/src/Functions/formatReadableTimeDelta.cpp +++ b/src/Functions/formatReadableTimeDelta.cpp @@ -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(