Make IFunction::executeImpl const.

This commit is contained in:
Nikolai Kochetov 2020-07-21 16:58:07 +03:00
parent 16e8c61438
commit e4689ce302
184 changed files with 500 additions and 490 deletions

View File

@ -89,7 +89,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const ColumnPtr column_string = block.getByPosition(arguments[0]).column;
const ColumnString * input = checkAndGetColumn<ColumnString>(column_string.get());

View File

@ -862,7 +862,7 @@ public:
return type_res;
}
bool executeFixedString(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeFixedString(Block & block, const ColumnNumbers & arguments, size_t result) const
{
using OpImpl = FixedStringOperationImpl<Op<UInt8, UInt8>>;
@ -940,7 +940,7 @@ public:
}
template <typename A, typename B>
bool executeNumeric(Block & block, const ColumnNumbers & arguments, size_t result [[maybe_unused]], const A & left, const B & right)
bool executeNumeric(Block & block, const ColumnNumbers & arguments, size_t result [[maybe_unused]], const A & left, const B & right) const
{
using LeftDataType = std::decay_t<decltype(left)>;
using RightDataType = std::decay_t<decltype(right)>;
@ -1073,7 +1073,7 @@ public:
return false;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
/// Special case when multiply aggregate function state
if (isAggregateMultiply(block.getByPosition(arguments[0]).type, block.getByPosition(arguments[1]).type))

View File

@ -54,7 +54,7 @@ public:
return std::make_shared<DataTypeUInt8>();
}
void executeImpl(Block & block , const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block , const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const auto value_col = block.getByPosition(arguments.front()).column.get();
@ -73,7 +73,7 @@ private:
template <typename T>
bool execute(
Block & block, const ColumnNumbers & arguments, const size_t result,
const IColumn * const value_col_untyped)
const IColumn * const value_col_untyped) const
{
if (const auto value_col = checkAndGetColumn<ColumnVector<T>>(value_col_untyped))
{
@ -132,7 +132,7 @@ private:
}
template <typename ValueType>
ValueType createConstMaskIfConst(const Block & block, const ColumnNumbers & arguments, bool & out_is_const)
ValueType createConstMaskIfConst(const Block & block, const ColumnNumbers & arguments, bool & out_is_const) const
{
out_is_const = true;
ValueType mask = 0;
@ -156,7 +156,7 @@ private:
}
template <typename ValueType>
PaddedPODArray<ValueType> createMask(const size_t size, const Block & block, const ColumnNumbers & arguments)
PaddedPODArray<ValueType> createMask(const size_t size, const Block & block, const ColumnNumbers & arguments) const
{
PaddedPODArray<ValueType> mask(size, ValueType{});
@ -175,7 +175,7 @@ private:
}
template <typename PosType, typename ValueType>
bool NO_SANITIZE_UNDEFINED addToMaskImpl(PaddedPODArray<ValueType> & mask, const IColumn * const pos_col_untyped)
bool NO_SANITIZE_UNDEFINED addToMaskImpl(PaddedPODArray<ValueType> & mask, const IColumn * const pos_col_untyped) const
{
if (const auto pos_col = checkAndGetColumn<ColumnVector<PosType>>(pos_col_untyped))
{

View File

@ -95,7 +95,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1, 2}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
WhichDataType which(from_type);

View File

@ -462,7 +462,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {2}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
WhichDataType which(from_type);

View File

@ -84,7 +84,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
WhichDataType which(from_type);

View File

@ -34,7 +34,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
block.getByPosition(result).column = block.getByPosition(result).type->createColumnConst(
input_rows_count, getFQDNOrHostName())->convertToFullColumnIfConst();

View File

@ -61,7 +61,7 @@ private:
}
template <typename LeftType, typename RightType>
bool executeTyped(Block & block, const size_t result, const ColumnConst * left_arg, const IColumn * right_arg)
bool executeTyped(Block & block, const size_t result, const ColumnConst * left_arg, const IColumn * right_arg) const
{
if (const auto right_arg_typed = checkAndGetColumn<ColumnVector<RightType>>(right_arg))
{
@ -100,7 +100,7 @@ private:
}
template <typename LeftType, typename RightType>
bool executeTyped(Block & block, const size_t result, const ColumnVector<LeftType> * left_arg, const IColumn * right_arg)
bool executeTyped(Block & block, const size_t result, const ColumnVector<LeftType> * left_arg, const IColumn * right_arg) const
{
if (const auto right_arg_typed = checkAndGetColumn<ColumnVector<RightType>>(right_arg))
{
@ -172,7 +172,7 @@ private:
return false;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnWithTypeAndName & col_left = block.getByPosition(arguments[0]);
const ColumnWithTypeAndName & col_right = block.getByPosition(arguments[1]);

View File

@ -25,7 +25,7 @@ private:
return std::make_shared<DataTypeFloat64>();
}
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
block.getByPosition(result).column = block.getByPosition(result).type->createColumnConst(input_rows_count, Impl::value);
}

View File

@ -143,7 +143,7 @@ private:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnWithTypeAndName & col = block.getByPosition(arguments[0]);

View File

@ -45,7 +45,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const auto in = block.getByPosition(arguments.front()).column.get();
@ -63,7 +63,7 @@ public:
}
template <typename T>
bool execute(Block & block, const IColumn * in_untyped, const size_t result)
bool execute(Block & block, const IColumn * in_untyped, const size_t result) const
{
if (const auto in = checkAndGetColumn<ColumnVector<T>>(in_untyped))
{

View File

@ -62,7 +62,7 @@ public:
return std::make_shared<DataTypeUInt8>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const IColumn * haystack_column = block.getByPosition(arguments[0]).column.get();
const IColumn * needle_column = block.getByPosition(arguments[1]).column.get();
@ -158,7 +158,7 @@ public:
#endif
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
selector.selectAndExecute(block, arguments, result, input_rows_count);
}

View File

@ -49,7 +49,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr column = block.getByPosition(arguments[0]).column;
if (const ColumnString * col = checkAndGetColumn<ColumnString>(column.get()))

View File

@ -52,7 +52,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr column_src = block.getByPosition(arguments[0]).column;
const ColumnPtr column_needle = block.getByPosition(arguments[1]).column;

View File

@ -51,7 +51,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr column = block.getByPosition(arguments[0]).column;
if (const ColumnString * col = checkAndGetColumn<ColumnString>(column.get()))

View File

@ -152,7 +152,7 @@ public:
return result;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
bool valid = castType(block.getByPosition(arguments[0]).type.get(), [&](const auto & type)
{

View File

@ -64,7 +64,7 @@ public:
}
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
using SourceColumnType = typename SourceDataType::ColumnType;
using ResultColumnType = typename ResultDataType::ColumnType;

View File

@ -122,7 +122,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /* input_rows_count */) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /* input_rows_count */) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
auto array_type = typeid_cast<const DataTypeArray *>(from_type);
@ -146,7 +146,7 @@ public:
private:
template <typename T>
void executeBitmapData(Block & block, DataTypes & argument_types, const ColumnNumbers & arguments, size_t result)
void executeBitmapData(Block & block, DataTypes & argument_types, const ColumnNumbers & arguments, size_t result) const
{
// input data
const ColumnArray * array = typeid_cast<const ColumnArray *>(block.getByPosition(arguments[0]).column.get());
@ -207,7 +207,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
// input data
const auto & return_type = block.getByPosition(result).type;
@ -299,7 +299,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
const DataTypeAggregateFunction * aggr_type = typeid_cast<const DataTypeAggregateFunction *>(from_type);
@ -435,7 +435,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
const DataTypeAggregateFunction * aggr_type = typeid_cast<const DataTypeAggregateFunction *>(from_type);
@ -568,7 +568,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
auto col_to = ColumnVector<ToType>::create(input_rows_count);
typename ColumnVector<ToType>::Container & vec_to = col_to->getData();
@ -596,7 +596,7 @@ private:
template <typename T>
void executeIntType(
Block & block, const ColumnNumbers & arguments, size_t input_rows_count, typename ColumnVector<ToType>::Container & vec_to)
Block & block, const ColumnNumbers & arguments, size_t input_rows_count, typename ColumnVector<ToType>::Container & vec_to) const
{
const ColumnAggregateFunction * column
= typeid_cast<const ColumnAggregateFunction *>(block.getByPosition(arguments[0]).column.get());
@ -738,7 +738,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
auto col_to = ColumnVector<UInt8>::create(input_rows_count);
typename ColumnVector<UInt8>::Container & vec_to = col_to->getData();
@ -764,7 +764,7 @@ public:
private:
template <typename T>
void executeIntType(
Block & block, const ColumnNumbers & arguments, size_t input_rows_count, typename ColumnVector<UInt8>::Container & vec_to)
Block & block, const ColumnNumbers & arguments, size_t input_rows_count, typename ColumnVector<UInt8>::Container & vec_to) const
{
const IColumn * columns[2];
bool is_column_const[2];
@ -835,7 +835,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
auto col_to = ColumnVector<ToType>::create(input_rows_count);
typename ColumnVector<ToType>::Container & vec_to = col_to->getData();
@ -861,7 +861,7 @@ public:
private:
template <typename T>
void executeIntType(
Block & block, const ColumnNumbers & arguments, size_t input_rows_count, typename ColumnVector<ToType>::Container & vec_to)
Block & block, const ColumnNumbers & arguments, size_t input_rows_count, typename ColumnVector<ToType>::Container & vec_to) const
{
const ColumnAggregateFunction * columns[2];
bool is_column_const[2];
@ -970,7 +970,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
const DataTypeAggregateFunction * aggr_type = typeid_cast<const DataTypeAggregateFunction *>(from_type);
@ -990,7 +990,7 @@ public:
private:
template <typename T>
void executeBitmapData(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
void executeBitmapData(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
const ColumnAggregateFunction * columns[2];
bool is_column_const[2];

View File

@ -88,7 +88,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const auto & col_type_name = block.getByPosition(arguments[0]);
const ColumnPtr & column = col_type_name.column;
@ -168,7 +168,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1, 2}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const auto & col_type_name = block.getByPosition(arguments[0]);
const ColumnPtr & column = col_type_name.column;
@ -249,7 +249,7 @@ private:
((unalignedLoad<UInt64>(address + 8) & 0x00000000FFFFFFFFull) == 0x00000000FFFF0000ull);
}
void cutAddress(const unsigned char * address, char *& dst, UInt8 zeroed_tail_bytes_count)
void cutAddress(const unsigned char * address, char *& dst, UInt8 zeroed_tail_bytes_count) const
{
formatIPv6(address, dst, zeroed_tail_bytes_count);
}
@ -277,7 +277,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr & column = block.getByPosition(arguments[0]).column;
@ -339,7 +339,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr & column = block.getByPosition(arguments[0]).column;
@ -407,7 +407,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr & column = block.getByPosition(arguments[0]).column;
@ -460,7 +460,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const auto & col_type_name = block.getByPosition(arguments[0]);
const ColumnPtr & column = col_type_name.column;
@ -578,7 +578,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr & column = block.getByPosition(arguments[0]).column;
@ -688,7 +688,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr & column = block.getByPosition(arguments[0]).column;
@ -755,7 +755,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnWithTypeAndName & col_type_name = block.getByPosition(arguments[0]);
const ColumnPtr & column = col_type_name.column;
@ -857,7 +857,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnWithTypeAndName & col_type_name = block.getByPosition(arguments[0]);
const ColumnPtr & column = col_type_name.column;
@ -959,7 +959,7 @@ public:
}
template <typename T>
void executeOneUInt(T x, char *& out)
void executeOneUInt(T x, char *& out) const
{
bool was_nonzero = false;
for (int offset = (sizeof(T) - 1) * 8; offset >= 0; offset -= 8)
@ -980,7 +980,7 @@ public:
}
template <typename T>
bool tryExecuteUInt(const IColumn * col, ColumnPtr & col_res)
bool tryExecuteUInt(const IColumn * col, ColumnPtr & col_res) const
{
const ColumnVector<T> * col_vec = checkAndGetColumn<ColumnVector<T>>(col);
@ -1025,7 +1025,7 @@ public:
}
template <typename T>
void executeFloatAndDecimal(const T & in_vec, ColumnPtr & col_res, const size_t type_size_in_bytes)
void executeFloatAndDecimal(const T & in_vec, ColumnPtr & col_res, const size_t type_size_in_bytes) const
{
const size_t hex_length = type_size_in_bytes * 2 + 1; /// Including trailing zero byte.
auto col_str = ColumnString::create();
@ -1051,7 +1051,7 @@ public:
}
template <typename T>
bool tryExecuteFloat(const IColumn * col, ColumnPtr & col_res)
bool tryExecuteFloat(const IColumn * col, ColumnPtr & col_res) const
{
const ColumnVector<T> * col_vec = checkAndGetColumn<ColumnVector<T>>(col);
if (col_vec)
@ -1067,7 +1067,7 @@ public:
}
template <typename T>
bool tryExecuteDecimal(const IColumn * col, ColumnPtr & col_res)
bool tryExecuteDecimal(const IColumn * col, ColumnPtr & col_res) const
{
const ColumnDecimal<T> * col_dec = checkAndGetColumn<ColumnDecimal<T>>(col);
if (col_dec)
@ -1083,7 +1083,7 @@ public:
}
void executeOneString(const UInt8 * pos, const UInt8 * end, char *& out)
void executeOneString(const UInt8 * pos, const UInt8 * end, char *& out) const
{
while (pos < end)
{
@ -1095,7 +1095,7 @@ public:
++out;
}
bool tryExecuteString(const IColumn * col, ColumnPtr & col_res)
bool tryExecuteString(const IColumn * col, ColumnPtr & col_res) const
{
const ColumnString * col_str_in = checkAndGetColumn<ColumnString>(col);
@ -1139,7 +1139,7 @@ public:
}
}
bool tryExecuteFixedString(const IColumn * col, ColumnPtr & col_res)
bool tryExecuteFixedString(const IColumn * col, ColumnPtr & col_res) const
{
const ColumnFixedString * col_fstr_in = checkAndGetColumn<ColumnFixedString>(col);
@ -1187,7 +1187,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const IColumn * column = block.getByPosition(arguments[0]).column.get();
ColumnPtr & res_column = block.getByPosition(result).column;
@ -1235,7 +1235,7 @@ public:
return std::make_shared<DataTypeString>();
}
void unhexOne(const char * pos, const char * end, char *& out)
void unhexOne(const char * pos, const char * end, char *& out) const
{
if ((end - pos) & 1)
{
@ -1255,7 +1255,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr & column = block.getByPosition(arguments[0]).column;
@ -1335,7 +1335,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
auto col_str = ColumnString::create();
ColumnString::Chars & out_vec = col_str->getChars();
@ -1379,7 +1379,7 @@ public:
private:
template <typename T>
bool executeNumber(const IColumn & src_data, ColumnString::Chars & out_vec, const size_t & column_idx, const size_t & rows, const size_t & size_per_row)
bool executeNumber(const IColumn & src_data, ColumnString::Chars & out_vec, const size_t & column_idx, const size_t & rows, const size_t & size_per_row) const
{
const ColumnVector<T> * src_data_concrete = checkAndGetColumn<ColumnVector<T>>(&src_data);
@ -1422,7 +1422,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
template <typename T>
bool tryExecute(const IColumn * column, ColumnPtr & out_column)
bool tryExecute(const IColumn * column, ColumnPtr & out_column) const
{
using UnsignedT = std::make_unsigned_t<T>;
@ -1461,7 +1461,7 @@ public:
}
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const IColumn * in_column = block.getByPosition(arguments[0]).column.get();
ColumnPtr & out_column = block.getByPosition(result).column;
@ -1506,7 +1506,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
bool tryExecuteString(const IColumn * col, ColumnPtr & col_res)
bool tryExecuteString(const IColumn * col, ColumnPtr & col_res) const
{
const ColumnString * col_str_in = checkAndGetColumn<ColumnString>(col);
@ -1553,7 +1553,7 @@ public:
}
}
bool tryExecuteFixedString(const IColumn * col, ColumnPtr & col_res)
bool tryExecuteFixedString(const IColumn * col, ColumnPtr & col_res) const
{
const ColumnFixedString * col_fstr_in = checkAndGetColumn<ColumnFixedString>(col);
@ -1599,7 +1599,7 @@ public:
}
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const IColumn * column = block.getByPosition(arguments[0]).column.get();
ColumnPtr & res_column = block.getByPosition(result).column;
@ -1668,7 +1668,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto & col_type_name_ip = block.getByPosition(arguments[0]);
const ColumnPtr & column_ip = col_type_name_ip.column;
@ -1772,7 +1772,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto & col_type_name_ip = block.getByPosition(arguments[0]);
const ColumnPtr & column_ip = col_type_name_ip.column;

View File

@ -566,7 +566,7 @@ private:
bool check_decimal_overflow = true;
template <typename T0, typename T1>
bool executeNumRightType(Block & block, size_t result, const ColumnVector<T0> * col_left, const IColumn * col_right_untyped)
bool executeNumRightType(Block & block, size_t result, const ColumnVector<T0> * col_left, const IColumn * col_right_untyped) const
{
if (const ColumnVector<T1> * col_right = checkAndGetColumn<ColumnVector<T1>>(col_right_untyped))
{
@ -595,7 +595,7 @@ private:
}
template <typename T0, typename T1>
bool executeNumConstRightType(Block & block, size_t result, const ColumnConst * col_left, const IColumn * col_right_untyped)
bool executeNumConstRightType(Block & block, size_t result, const ColumnConst * col_left, const IColumn * col_right_untyped) const
{
if (const ColumnVector<T1> * col_right = checkAndGetColumn<ColumnVector<T1>>(col_right_untyped))
{
@ -621,7 +621,7 @@ private:
}
template <typename T0>
bool executeNumLeftType(Block & block, size_t result, const IColumn * col_left_untyped, const IColumn * col_right_untyped)
bool executeNumLeftType(Block & block, size_t result, const IColumn * col_left_untyped, const IColumn * col_right_untyped) const
{
if (const ColumnVector<T0> * col_left = checkAndGetColumn<ColumnVector<T0>>(col_left_untyped))
{
@ -667,7 +667,7 @@ private:
return false;
}
void executeDecimal(Block & block, size_t result, const ColumnWithTypeAndName & col_left, const ColumnWithTypeAndName & col_right)
void executeDecimal(Block & block, size_t result, const ColumnWithTypeAndName & col_left, const ColumnWithTypeAndName & col_right) const
{
TypeIndex left_number = col_left.type->getTypeId();
TypeIndex right_number = col_right.type->getTypeId();
@ -690,7 +690,7 @@ private:
ErrorCodes::LOGICAL_ERROR);
}
bool executeString(Block & block, size_t result, const IColumn * c0, const IColumn * c1)
bool executeString(Block & block, size_t result, const IColumn * c0, const IColumn * c1) const
{
const ColumnString * c0_string = checkAndGetColumn<ColumnString>(c0);
const ColumnString * c1_string = checkAndGetColumn<ColumnString>(c1);
@ -816,7 +816,7 @@ private:
bool executeWithConstString(
Block & block, size_t result, const IColumn * col_left_untyped, const IColumn * col_right_untyped,
const DataTypePtr & left_type, const DataTypePtr & right_type, size_t input_rows_count)
const DataTypePtr & left_type, const DataTypePtr & right_type, size_t input_rows_count) const
{
/// To compare something with const string, we cast constant to appropriate type and compare as usual.
/// It is ok to throw exception if value is not convertible.
@ -860,7 +860,7 @@ private:
}
void executeTuple(Block & block, size_t result, const ColumnWithTypeAndName & c0, const ColumnWithTypeAndName & c1,
size_t input_rows_count)
size_t input_rows_count) const
{
/** We will lexicographically compare the tuples. This is done as follows:
* x == y : x1 == y1 && x2 == y2 ...
@ -917,7 +917,7 @@ private:
void executeTupleImpl(Block & block, size_t result, const ColumnsWithTypeAndName & x,
const ColumnsWithTypeAndName & y, size_t tuple_size,
size_t input_rows_count);
size_t input_rows_count) const;
void executeTupleEqualityImpl(
std::shared_ptr<IFunctionOverloadResolver> func_compare,
@ -927,7 +927,7 @@ private:
const ColumnsWithTypeAndName & x,
const ColumnsWithTypeAndName & y,
size_t tuple_size,
size_t input_rows_count)
size_t input_rows_count) const
{
if (0 == tuple_size)
throw Exception("Comparison of zero-sized tuples is not implemented.", ErrorCodes::NOT_IMPLEMENTED);
@ -979,7 +979,7 @@ private:
const ColumnsWithTypeAndName & x,
const ColumnsWithTypeAndName & y,
size_t tuple_size,
size_t input_rows_count)
size_t input_rows_count) const
{
Block tmp_block;
@ -1051,7 +1051,7 @@ private:
block.getByPosition(result).column = tmp_block.getByPosition(tmp_block.columns() - 1).column;
}
void executeGenericIdenticalTypes(Block & block, size_t result, const IColumn * c0, const IColumn * c1)
void executeGenericIdenticalTypes(Block & block, size_t result, const IColumn * c0, const IColumn * c1) const
{
bool c0_const = isColumnConst(*c0);
bool c1_const = isColumnConst(*c1);
@ -1079,7 +1079,7 @@ private:
}
}
void executeGeneric(Block & block, size_t result, const ColumnWithTypeAndName & c0, const ColumnWithTypeAndName & c1)
void executeGeneric(Block & block, size_t result, const ColumnWithTypeAndName & c0, const ColumnWithTypeAndName & c1) const
{
DataTypePtr common_type = getLeastSupertype({c0.type, c1.type});
@ -1153,7 +1153,7 @@ public:
return std::make_shared<DataTypeUInt8>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto & col_with_type_and_name_left = block.getByPosition(arguments[0]);
const auto & col_with_type_and_name_right = block.getByPosition(arguments[1]);

View File

@ -65,7 +65,7 @@ public:
return {1};
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
if (isColumnConst(*block.getByPosition(arguments[1]).column))
executeConstBuckets(block, arguments, result);
@ -80,7 +80,7 @@ private:
using BucketsType = typename Impl::BucketsType;
template <typename T>
inline BucketsType checkBucketsRange(T buckets)
inline BucketsType checkBucketsRange(T buckets) const
{
if (unlikely(buckets <= 0))
throw Exception(
@ -93,7 +93,7 @@ private:
return static_cast<BucketsType>(buckets);
}
void executeConstBuckets(Block & block, const ColumnNumbers & arguments, size_t result)
void executeConstBuckets(Block & block, const ColumnNumbers & arguments, size_t result) const
{
Field buckets_field = (*block.getByPosition(arguments[1]).column)[0];
BucketsType num_buckets;
@ -136,7 +136,7 @@ private:
}
template <typename CurrentHashType>
void executeType(const ColumnPtr & col_hash_ptr, BucketsType num_buckets, ColumnVector<ResultType> * col_result)
void executeType(const ColumnPtr & col_hash_ptr, BucketsType num_buckets, ColumnVector<ResultType> * col_result) const
{
auto col_hash = checkAndGetColumn<ColumnVector<CurrentHashType>>(col_hash_ptr.get());
if (!col_hash)

View File

@ -995,7 +995,7 @@ public:
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; }
bool canBeExecutedOnDefaultArguments() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
try
{
@ -1040,7 +1040,7 @@ public:
}
private:
void executeInternal(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
void executeInternal(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
if (!arguments.size())
throw Exception{"Function " + getName() + " expects at least 1 arguments",
@ -1223,7 +1223,7 @@ public:
return res;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();

View File

@ -183,7 +183,7 @@ public:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
/// The dictionary key that defines the "point of view".
std::string dict_key;
@ -279,7 +279,7 @@ public:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
/// The dictionary key that defines the "point of view".
std::string dict_key;
@ -415,7 +415,7 @@ public:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
/// The dictionary key that defines the "point of view".
std::string dict_key;
@ -620,7 +620,7 @@ public:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
RegionsNames::Language language = RegionsNames::Language::ru;

View File

@ -160,7 +160,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
/** Do not require existence of the dictionary if the function is called for empty block.
* This is needed to allow successful query analysis on a server,
@ -200,7 +200,7 @@ private:
template <typename DictionaryType>
bool executeDispatchSimple(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -223,7 +223,7 @@ private:
template <typename DictionaryType>
bool executeDispatchComplex(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -323,7 +323,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
if (input_rows_count == 0)
{
@ -357,7 +357,7 @@ private:
template <typename DictionaryType>
bool executeDispatch(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -388,7 +388,7 @@ private:
template <typename DictionaryType>
bool executeDispatchComplex(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -425,7 +425,7 @@ private:
template <typename DictionaryType>
bool executeDispatchRange(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -507,7 +507,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
if (input_rows_count == 0)
{
@ -540,7 +540,7 @@ private:
template <typename DictionaryType>
bool executeDispatch(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -566,7 +566,7 @@ private:
template <typename DictionaryType>
void executeDispatch(
Block & block, const ColumnNumbers & arguments, const size_t result, const DictionaryType * dict,
const std::string & attr_name, const ColumnUInt64 * id_col)
const std::string & attr_name, const ColumnUInt64 * id_col) const
{
const auto default_col_untyped = block.getByPosition(arguments[3]).column.get();
@ -594,7 +594,7 @@ private:
template <typename DictionaryType>
void executeDispatch(
Block & block, const ColumnNumbers & arguments, const size_t result, const DictionaryType * dict,
const std::string & attr_name, const ColumnConst * id_col)
const std::string & attr_name, const ColumnConst * id_col) const
{
const auto default_col_untyped = block.getByPosition(arguments[3]).column.get();
@ -628,7 +628,7 @@ private:
template <typename DictionaryType>
bool executeDispatchComplex(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -847,7 +847,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
if (input_rows_count == 0)
{
@ -880,7 +880,7 @@ private:
}
template <typename DictionaryType>
bool executeDispatch(Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
bool executeDispatch(Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -936,7 +936,7 @@ private:
template <typename DictionaryType>
bool executeDispatchComplex(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -979,7 +979,7 @@ private:
template <typename DictionaryType>
bool executeDispatchRange(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -1108,7 +1108,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
if (input_rows_count == 0)
{
@ -1140,7 +1140,7 @@ private:
}
template <typename DictionaryType>
bool executeDispatch(Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
bool executeDispatch(Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -1166,7 +1166,7 @@ private:
template <typename DictionaryType>
void executeDispatch(
Block & block, const ColumnNumbers & arguments, const size_t result, const DictionaryType * dict,
const std::string & attr_name, const ColumnUInt64 * id_col)
const std::string & attr_name, const ColumnUInt64 * id_col) const
{
const auto default_col_untyped = block.getByPosition(arguments[3]).column.get();
@ -1205,7 +1205,7 @@ private:
template <typename DictionaryType>
void executeDispatch(
Block & block, const ColumnNumbers & arguments, const size_t result, const DictionaryType * dict,
const std::string & attr_name, const ColumnConst * id_col)
const std::string & attr_name, const ColumnConst * id_col) const
{
const auto default_col_untyped = block.getByPosition(arguments[3]).column.get();
@ -1263,7 +1263,7 @@ private:
template <typename DictionaryType>
bool executeDispatchComplex(
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr)
Block & block, const ColumnNumbers & arguments, const size_t result, const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -1490,7 +1490,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
impl->executeImpl(block, arguments, result, input_rows_count);
}
@ -1632,7 +1632,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
impl->executeImpl(block, arguments, result, input_rows_count);
}
@ -1681,7 +1681,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
if (input_rows_count == 0)
{
@ -1701,7 +1701,7 @@ private:
template <typename DictionaryType>
bool executeDispatch(Block & block, const ColumnNumbers & arguments, const size_t result,
const std::shared_ptr<const IDictionaryBase> & dict_ptr)
const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -1838,7 +1838,7 @@ private:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
if (input_rows_count == 0)
{
@ -1858,7 +1858,7 @@ private:
template <typename DictionaryType>
bool executeDispatch(Block & block, const ColumnNumbers & arguments, const size_t result,
const std::shared_ptr<const IDictionaryBase> & dict_ptr)
const std::shared_ptr<const IDictionaryBase> & dict_ptr) const
{
const auto dict = typeid_cast<const DictionaryType *>(dict_ptr.get());
if (!dict)
@ -1883,7 +1883,7 @@ private:
template <typename DictionaryType>
bool execute(Block & block, const size_t result, const DictionaryType * dict,
const ColumnUInt64 * child_id_col, const IColumn * ancestor_id_col_untyped)
const ColumnUInt64 * child_id_col, const IColumn * ancestor_id_col_untyped) const
{
if (const auto ancestor_id_col = checkAndGetColumn<ColumnUInt64>(ancestor_id_col_untyped))
{
@ -1922,7 +1922,7 @@ private:
template <typename DictionaryType>
bool execute(Block & block, const size_t result, const DictionaryType * dict,
const ColumnConst * child_id_col, const IColumn * ancestor_id_col_untyped)
const ColumnConst * child_id_col, const IColumn * ancestor_id_col_untyped) const
{
if (const auto ancestor_id_col = checkAndGetColumn<ColumnUInt64>(ancestor_id_col_untyped))
{

View File

@ -71,7 +71,7 @@ DataTypePtr FunctionModelEvaluate::getReturnTypeImpl(const ColumnsWithTypeAndNam
return type;
}
void FunctionModelEvaluate::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/)
void FunctionModelEvaluate::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const
{
const auto * name_col = checkAndGetColumnConst<ColumnString>(block.getByPosition(arguments[0]).column.get());
if (!name_col)

View File

@ -31,7 +31,7 @@ public:
DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
private:
const ExternalModelsLoader & models_loader;

View File

@ -56,7 +56,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
if (!(executeType<UInt8>(block, arguments, result)
|| executeType<UInt16>(block, arguments, result)
@ -92,7 +92,7 @@ private:
}
template <typename T>
bool executeType(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeType(Block & block, const ColumnNumbers & arguments, size_t result) const
{
if (const ColumnVector<T> * col_from = checkAndGetColumn<ColumnVector<T>>(block.getByPosition(arguments[0]).column.get()))
{
@ -152,7 +152,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
if (!(executeType<UInt8>(block, arguments, result)
|| executeType<UInt16>(block, arguments, result)
@ -171,7 +171,7 @@ public:
private:
template <typename T>
bool executeType(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeType(Block & block, const ColumnNumbers & arguments, size_t result) const
{
if (const ColumnVector<T> * col_from = checkAndGetColumn<ColumnVector<T>>(block.getByPosition(arguments[0]).column.get()))
{

View File

@ -542,7 +542,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
if (const ColumnString * col_from = checkAndGetColumn<ColumnString>(block.getByPosition(arguments[0]).column.get()))
{
@ -603,7 +603,7 @@ private:
using ToType = typename Impl::ReturnType;
template <typename FromType>
void executeType(Block & block, const ColumnNumbers & arguments, size_t result)
void executeType(Block & block, const ColumnNumbers & arguments, size_t result) const
{
if (auto col_from = checkAndGetColumn<ColumnVector<FromType>>(block.getByPosition(arguments[0]).column.get()))
{
@ -644,7 +644,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
WhichDataType which(from_type);
@ -684,7 +684,7 @@ public:
#endif
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
selector.selectAndExecute(block, arguments, result, input_rows_count);
}
@ -710,7 +710,7 @@ private:
using ToType = typename Impl::ReturnType;
template <typename FromType, bool first>
void executeIntType(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to)
void executeIntType(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
{
if (const ColumnVector<FromType> * col_from = checkAndGetColumn<ColumnVector<FromType>>(column))
{
@ -765,7 +765,7 @@ private:
}
template <bool first>
void executeGeneric(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to)
void executeGeneric(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
{
for (size_t i = 0, size = column->size(); i < size; ++i)
{
@ -779,7 +779,7 @@ private:
}
template <bool first>
void executeString(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to)
void executeString(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
{
if (const ColumnString * col_from = checkAndGetColumn<ColumnString>(column))
{
@ -842,7 +842,7 @@ private:
}
template <bool first>
void executeArray(const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to)
void executeArray(const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
{
const IDataType * nested_type = typeid_cast<const DataTypeArray *>(type)->getNestedType().get();
@ -892,7 +892,7 @@ private:
}
template <bool first>
void executeAny(const IDataType * from_type, const IColumn * icolumn, typename ColumnVector<ToType>::Container & vec_to)
void executeAny(const IDataType * from_type, const IColumn * icolumn, typename ColumnVector<ToType>::Container & vec_to) const
{
WhichDataType which(from_type);
@ -917,7 +917,7 @@ private:
executeGeneric<first>(icolumn, vec_to);
}
void executeForArgument(const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to, bool & is_first)
void executeForArgument(const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to, bool & is_first) const
{
/// Flattening of tuples.
if (const ColumnTuple * tuple = typeid_cast<const ColumnTuple *>(column))
@ -965,7 +965,7 @@ public:
return std::make_shared<DataTypeNumber<ToType>>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
size_t rows = input_rows_count;
auto col_to = ColumnVector<ToType>::create(rows);
@ -1010,7 +1010,7 @@ public:
#endif
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
selector.selectAndExecute(block, arguments, result, input_rows_count);
}
@ -1133,7 +1133,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const auto arg_count = arguments.size();

View File

@ -286,7 +286,7 @@ public:
return Impl<DummyJSONParser>::getReturnType(Name::name, arguments);
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result_pos, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result_pos, size_t input_rows_count) const override
{
/// Choose JSONParser.
#if USE_SIMDJSON

View File

@ -499,7 +499,7 @@ DataTypePtr FunctionAnyArityLogical<Impl, Name>::getReturnTypeImpl(const DataTyp
template <typename Impl, typename Name>
void FunctionAnyArityLogical<Impl, Name>::executeImpl(
Block & block, const ColumnNumbers & arguments, size_t result_index, size_t input_rows_count)
Block & block, const ColumnNumbers & arguments, size_t result_index, size_t input_rows_count) const
{
ColumnRawPtrs args_in;
for (const auto arg_index : arguments)
@ -559,7 +559,7 @@ bool functionUnaryExecuteType(Block & block, const ColumnNumbers & arguments, si
}
template <template <typename> class Impl, typename Name>
void FunctionUnaryLogical<Impl, Name>::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/)
void FunctionUnaryLogical<Impl, Name>::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const
{
if (!(functionUnaryExecuteType<Impl, UInt8>(block, arguments, result)
|| functionUnaryExecuteType<Impl, UInt16>(block, arguments, result)

View File

@ -154,7 +154,7 @@ public:
/// Get result types by argument types. If the function does not apply to these arguments, throw an exception.
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result_index, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result_index, size_t input_rows_count) const override;
#if USE_EMBEDDED_COMPILER
bool isCompilableImpl(const DataTypes &) const override { return useDefaultImplementationForNulls(); }
@ -215,7 +215,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override;
#if USE_EMBEDDED_COMPILER
bool isCompilableImpl(const DataTypes &) const override { return true; }

View File

@ -66,7 +66,7 @@ public:
return Impl::getReturnType();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
using ResultType = typename Impl::ResultType;

View File

@ -73,7 +73,7 @@ public:
return std::make_shared<DataTypeArray>(std::make_shared<DataTypeUInt64>());
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
using ResultType = typename Impl::ResultType;

View File

@ -75,7 +75,7 @@ public:
return Impl::getReturnType();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
using ResultType = typename Impl::ResultType;

View File

@ -74,7 +74,7 @@ public:
return std::make_shared<DataTypeNumber<ToType>>();
}
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
auto col_to = ColumnVector<ToType>::create();
typename ColumnVector<ToType>::Container & vec_to = col_to->getData();
@ -102,7 +102,7 @@ public:
#endif
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
selector.selectAndExecute(block, arguments, result, input_rows_count);
}

View File

@ -551,7 +551,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnWithTypeAndName & column = block.getByPosition(arguments[0]);
Int64 scale_arg = getScaleArg(block, arguments);
@ -631,7 +631,7 @@ public:
return getLeastSupertype({type_x, type_arr_nested});
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) const override
{
auto in_column = block.getByPosition(arguments[0]).column;
const auto & in_type = block.getByPosition(arguments[0]).type;
@ -677,7 +677,7 @@ public:
private:
template <typename T>
bool executeNum(const IColumn * in_untyped, IColumn * out_untyped, const Array & boundaries)
bool executeNum(const IColumn * in_untyped, IColumn * out_untyped, const Array & boundaries) const
{
const auto in = checkAndGetColumn<ColumnVector<T>>(in_untyped);
auto out = typeid_cast<ColumnVector<T> *>(out_untyped);
@ -689,7 +689,7 @@ private:
}
template <typename T>
bool executeDecimal(const IColumn * in_untyped, IColumn * out_untyped, const Array & boundaries)
bool executeDecimal(const IColumn * in_untyped, IColumn * out_untyped, const Array & boundaries) const
{
const auto in = checkAndGetColumn<ColumnDecimal<T>>(in_untyped);
auto out = typeid_cast<ColumnDecimal<T> *>(out_untyped);
@ -701,7 +701,7 @@ private:
}
template <typename Container>
void NO_INLINE executeImplNumToNum(const Container & src, Container & dst, const Array & boundaries)
void NO_INLINE executeImplNumToNum(const Container & src, Container & dst, const Array & boundaries) const
{
using ValueType = typename Container::value_type;
std::vector<ValueType> boundary_values(boundaries.size());

View File

@ -361,7 +361,7 @@ public:
return std::make_shared<DataTypeArray>(std::make_shared<DataTypeString>());
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
Generator generator;
generator.init(block, arguments);
@ -454,7 +454,7 @@ private:
const ColumnArray::Offsets & src_array_offsets,
const char * delimiter, const size_t delimiter_size,
ColumnString::Chars & dst_chars,
ColumnString::Offsets & dst_string_offsets)
ColumnString::Offsets & dst_string_offsets) const
{
size_t size = src_array_offsets.size();
@ -536,7 +536,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
String delimiter;
if (arguments.size() == 2)

View File

@ -75,7 +75,7 @@ public:
return std::make_shared<DataTypeNumber<typename Impl::ResultType>>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
using ResultType = typename Impl::ResultType;

View File

@ -58,7 +58,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnPtr column = block.getByPosition(arguments[0]).column;
const ColumnPtr column_needle = block.getByPosition(arguments[1]).column;

View File

@ -51,7 +51,7 @@ public:
return std::make_shared<DataTypeNumber<typename Impl::ResultType>>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
using ResultType = typename Impl::ResultType;

View File

@ -52,7 +52,7 @@ void sliceFromRightConstantOffsetBounded(IArraySource & src, IArraySink & sink,
void sliceDynamicOffsetUnbounded(IArraySource & src, IArraySink & sink, const IColumn & offset_column);
void sliceDynamicOffsetBounded(IArraySource & src, IArraySink & sink, const IColumn & offset_column, const IColumn & length_column);
void sliceHas(IArraySource & first, IArraySource & second, ArraySearchType & search_type, ColumnUInt8 & result);
void sliceHas(IArraySource & first, IArraySource & second, ArraySearchType search_type, ColumnUInt8 & result);
void push(IArraySource & array_source, IValueSource & value_source, IArraySink & sink, bool push_front);

View File

@ -8,7 +8,7 @@ namespace DB::GatherUtils
struct ArrayHasSelectArraySourcePair : public ArraySourcePairSelector<ArrayHasSelectArraySourcePair>
{
template <typename FirstSource, typename SecondSource>
static void selectSourcePair(FirstSource && first, SecondSource && second, ArraySearchType & search_type, ColumnUInt8 & result)
static void selectSourcePair(FirstSource && first, SecondSource && second, ArraySearchType search_type, ColumnUInt8 & result)
{
switch (search_type)
{
@ -27,7 +27,7 @@ struct ArrayHasSelectArraySourcePair : public ArraySourcePairSelector<ArrayHasSe
};
void sliceHas(IArraySource & first, IArraySource & second, ArraySearchType & search_type, ColumnUInt8 & result)
void sliceHas(IArraySource & first, IArraySource & second, ArraySearchType search_type, ColumnUInt8 & result)
{
ArrayHasSelectArraySourcePair::select(first, second, search_type, result);
}

View File

@ -201,8 +201,8 @@ public:
virtual String getName() const = 0;
virtual void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) = 0;
virtual void executeImplDryRun(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
virtual void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const = 0;
virtual void executeImplDryRun(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
executeImpl(block, arguments, result, input_rows_count);
}

View File

@ -46,7 +46,7 @@ private:
return getLeastSupertype(types);
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
size_t num_arguments = arguments.size();
if (1 == num_arguments)

View File

@ -204,7 +204,7 @@ public:
* If FunctionInterface is IFunction, then "executeImpl" method of the implementation will be called
* and "execute" otherwise.
*/
void selectAndExecute(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
void selectAndExecute(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
if (implementations.empty())
throw Exception("There are no available implementations for function " "TODO(dakovalkov): add name",
@ -257,7 +257,7 @@ public:
private:
const Context & context;
std::vector<ImplementationPtr> implementations;
detail::PerformanceStatistics statistics;
mutable detail::PerformanceStatistics statistics; /// It is protected by internal mutex.
};
}

View File

@ -48,7 +48,7 @@ struct FunctionPort : public IFunction
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) const override
{
UInt16 default_port = 0;
if (arguments.size() == 2)

View File

@ -71,7 +71,7 @@ public:
return true;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const ColumnPtr & column = block.getByPosition(arguments[0]).column;
const ColumnUInt64 * column_concrete = checkAndGetColumn<ColumnUInt64>(column.get());
@ -92,19 +92,24 @@ public:
}
private:
std::mutex mutex;
Arena arena;
using Map = HashMap<uintptr_t, StringRef>;
Map map;
std::unordered_map<std::string, Dwarf> dwarfs;
struct Cache
{
std::mutex mutex;
Arena arena;
using Map = HashMap<uintptr_t, StringRef>;
Map map;
std::unordered_map<std::string, Dwarf> dwarfs;
};
StringRef impl(uintptr_t addr)
mutable Cache cache;
StringRef impl(uintptr_t addr) const
{
const SymbolIndex & symbol_index = SymbolIndex::instance();
if (const auto * object = symbol_index.findObject(reinterpret_cast<const void *>(addr)))
{
auto dwarf_it = dwarfs.try_emplace(object->name, *object->elf).first;
auto dwarf_it = cache.dwarfs.try_emplace(object->name, *object->elf).first;
if (!std::filesystem::exists(object->name))
return {};
@ -112,7 +117,7 @@ private:
if (dwarf_it->second.findAddress(addr - uintptr_t(object->address_begin), location, Dwarf::LocationInfoMode::FAST))
{
const char * arena_begin = nullptr;
WriteBufferFromArena out(arena, arena_begin);
WriteBufferFromArena out(cache.arena, arena_begin);
writeString(location.file.toString(), out);
writeChar(':', out);
@ -129,12 +134,12 @@ private:
return {};
}
StringRef implCached(uintptr_t addr)
StringRef implCached(uintptr_t addr) const
{
Map::LookupResult it;
Cache::Map::LookupResult it;
bool inserted;
std::lock_guard lock(mutex);
map.emplace(addr, it, inserted);
std::lock_guard lock(cache.mutex);
cache.map.emplace(addr, it, inserted);
if (inserted)
it->getMapped() = impl(addr);
return it->getMapped();

View File

@ -62,7 +62,7 @@ public:
return true;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const SymbolIndex & symbol_index = SymbolIndex::instance();

View File

@ -53,7 +53,7 @@ private:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const auto & column = block.getByPosition(arguments[0]).column;
const auto & column_char = block.getByPosition(arguments[1]).column;

View File

@ -135,7 +135,7 @@ public:
}
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
if (arguments.size() == 1)
{

View File

@ -30,7 +30,7 @@ public:
return std::make_shared<DataTypeArray>(getLeastSupertype(arguments));
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
size_t num_elements = arguments.size();

View File

@ -49,7 +49,7 @@ public:
return getLeastSupertype(arguments);
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const DataTypePtr & return_type = block.getByPosition(result).type;

View File

@ -55,7 +55,7 @@ public:
return std::make_shared<DataTypeArray>(nested_type);
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
private:
/// Initially allocate a piece of memory for 512 elements. NOTE: This is just a guess.
@ -85,7 +85,7 @@ private:
};
void FunctionArrayDistinct::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/)
void FunctionArrayDistinct::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const
{
ColumnPtr array_ptr = block.getByPosition(arguments[0]).column;
const ColumnArray * array = checkAndGetColumn<ColumnArray>(array_ptr.get());

View File

@ -46,11 +46,11 @@ public:
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
private:
void perform(Block & block, const ColumnNumbers & arguments, size_t result,
ArrayImpl::NullMapBuilder & builder, size_t input_rows_count);
ArrayImpl::NullMapBuilder & builder, size_t input_rows_count) const;
template <typename DataType>
static bool executeNumberConst(Block & block, const ColumnNumbers & arguments, size_t result, const Field & index,
@ -81,11 +81,11 @@ private:
template <typename IndexType>
bool executeArgument(Block & block, const ColumnNumbers & arguments, size_t result,
ArrayImpl::NullMapBuilder & builder, size_t input_rows_count);
ArrayImpl::NullMapBuilder & builder, size_t input_rows_count) const;
/** For a tuple array, the function is evaluated component-wise for each element of the tuple.
*/
bool executeTuple(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count);
bool executeTuple(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const;
};
@ -636,7 +636,7 @@ bool FunctionArrayElement::executeConst(Block & block, const ColumnNumbers & arg
template <typename IndexType>
bool FunctionArrayElement::executeArgument(Block & block, const ColumnNumbers & arguments, size_t result,
ArrayImpl::NullMapBuilder & builder, size_t input_rows_count)
ArrayImpl::NullMapBuilder & builder, size_t input_rows_count) const
{
auto index = checkAndGetColumn<ColumnVector<IndexType>>(block.getByPosition(arguments[1]).column.get());
@ -667,7 +667,7 @@ bool FunctionArrayElement::executeArgument(Block & block, const ColumnNumbers &
return true;
}
bool FunctionArrayElement::executeTuple(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
bool FunctionArrayElement::executeTuple(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
const ColumnArray * col_array = typeid_cast<const ColumnArray *>(block.getByPosition(arguments[0]).column.get());
@ -748,7 +748,7 @@ DataTypePtr FunctionArrayElement::getReturnTypeImpl(const DataTypes & arguments)
return array_type->getNestedType();
}
void FunctionArrayElement::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
void FunctionArrayElement::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
/// Check nullability.
bool is_array_of_nullable = false;
@ -840,7 +840,7 @@ void FunctionArrayElement::executeImpl(Block & block, const ColumnNumbers & argu
}
void FunctionArrayElement::perform(Block & block, const ColumnNumbers & arguments, size_t result,
ArrayImpl::NullMapBuilder & builder, size_t input_rows_count)
ArrayImpl::NullMapBuilder & builder, size_t input_rows_count) const
{
if (executeTuple(block, arguments, result, input_rows_count))
{

View File

@ -45,7 +45,7 @@ public:
return std::make_shared<DataTypeArray>(std::make_shared<DataTypeUInt32>());
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) const override
{
if (const ColumnArray * array = checkAndGetColumn<ColumnArray>(block.getByPosition(arguments[0]).column.get()))
{

View File

@ -55,7 +55,7 @@ public:
return std::make_shared<DataTypeArray>(std::make_shared<DataTypeUInt32>());
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
private:
/// Initially allocate a piece of memory for 512 elements. NOTE: This is just a guess.
@ -104,23 +104,23 @@ private:
template <typename Method>
void executeMethod(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, const Sizes & key_sizes,
const NullMap * null_map, ColumnUInt32::Container & res_values);
const NullMap * null_map, ColumnUInt32::Container & res_values) const;
template <typename Method, bool has_null_map>
void executeMethodImpl(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, const Sizes & key_sizes,
const NullMap * null_map, ColumnUInt32::Container & res_values);
const NullMap * null_map, ColumnUInt32::Container & res_values) const;
template <typename T>
bool executeNumber(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values);
bool executeString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values);
bool executeFixedString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values);
bool execute128bit(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, ColumnUInt32::Container & res_values);
void executeHashed(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, ColumnUInt32::Container & res_values);
bool executeNumber(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const;
bool executeString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const;
bool executeFixedString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const;
bool execute128bit(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, ColumnUInt32::Container & res_values) const;
void executeHashed(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, ColumnUInt32::Container & res_values) const;
};
template <typename Derived>
void FunctionArrayEnumerateExtended<Derived>::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/)
void FunctionArrayEnumerateExtended<Derived>::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const
{
const ColumnArray::Offsets * offsets = nullptr;
size_t num_arguments = arguments.size();
@ -210,7 +210,7 @@ void FunctionArrayEnumerateExtended<Derived>::executeMethodImpl(
const ColumnRawPtrs & columns,
const Sizes & key_sizes,
[[maybe_unused]] const NullMap * null_map,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
typename Method::Set indices;
typename Method::Method method(columns, key_sizes, nullptr);
@ -290,7 +290,7 @@ void FunctionArrayEnumerateExtended<Derived>::executeMethod(
const ColumnRawPtrs & columns,
const Sizes & key_sizes,
const NullMap * null_map,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
if (null_map)
executeMethodImpl<Method, true>(offsets, columns, key_sizes, null_map, res_values);
@ -302,7 +302,7 @@ void FunctionArrayEnumerateExtended<Derived>::executeMethod(
template <typename Derived>
template <typename T>
bool FunctionArrayEnumerateExtended<Derived>::executeNumber(
const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values)
const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const
{
const auto * nested = checkAndGetColumn<ColumnVector<T>>(&data);
if (!nested)
@ -314,7 +314,7 @@ bool FunctionArrayEnumerateExtended<Derived>::executeNumber(
template <typename Derived>
bool FunctionArrayEnumerateExtended<Derived>::executeString(
const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values)
const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const
{
const auto * nested = checkAndGetColumn<ColumnString>(&data);
if (nested)
@ -325,7 +325,7 @@ bool FunctionArrayEnumerateExtended<Derived>::executeString(
template <typename Derived>
bool FunctionArrayEnumerateExtended<Derived>::executeFixedString(
const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values)
const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const
{
const auto * nested = checkAndGetColumn<ColumnString>(&data);
if (nested)
@ -338,7 +338,7 @@ template <typename Derived>
bool FunctionArrayEnumerateExtended<Derived>::execute128bit(
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
size_t count = columns.size();
size_t keys_bytes = 0;
@ -360,7 +360,7 @@ template <typename Derived>
void FunctionArrayEnumerateExtended<Derived>::executeHashed(
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
executeMethod<MethodHashed>(offsets, columns, {}, nullptr, res_values);
}

View File

@ -115,7 +115,7 @@ public:
return type;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
private:
/// Initially allocate a piece of memory for 512 elements. NOTE: This is just a guess.
@ -125,7 +125,7 @@ private:
const std::vector<const ColumnArray::Offsets *> & offsets_by_depth,
const ColumnRawPtrs & columns,
const ArraysDepths & arrays_depths,
ColumnUInt32::Container & res_values);
ColumnUInt32::Container & res_values) const;
};
@ -149,7 +149,7 @@ static inline UInt128 ALWAYS_INLINE hash128depths(const std::vector<size_t> & in
template <typename Derived>
void FunctionArrayEnumerateRankedExtended<Derived>::executeImpl(
Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/)
Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const
{
size_t num_arguments = arguments.size();
ColumnRawPtrs data_columns;
@ -302,7 +302,7 @@ void FunctionArrayEnumerateRankedExtended<Derived>::executeMethodImpl(
const std::vector<const ColumnArray::Offsets *> & offsets_by_depth,
const ColumnRawPtrs & columns,
const ArraysDepths & arrays_depths,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
/// Offsets at the depth we want to look.
const size_t depth_to_look = arrays_depths.max_array_depth;

View File

@ -39,7 +39,7 @@ public:
return std::make_shared<DataTypeArray>(nested_type);
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
/** We create an array column with array elements as the most deep elements of nested arrays,
* and construct offsets by selecting elements of most deep offsets by values of ancestor offsets.

View File

@ -596,7 +596,7 @@ private:
using ResultColumnType = ColumnVector<typename IndexConv::ResultType>;
template <typename T>
bool executeNumber(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeNumber(Block & block, const ColumnNumbers & arguments, size_t result) const
{
return executeNumberNumber<T, UInt8>(block, arguments, result)
|| executeNumberNumber<T, UInt16>(block, arguments, result)
@ -611,7 +611,7 @@ private:
}
template <typename T, typename U>
bool executeNumberNumber(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeNumberNumber(Block & block, const ColumnNumbers & arguments, size_t result) const
{
const ColumnArray * col_array = checkAndGetColumn<ColumnArray>(block.getByPosition(arguments[0]).column.get());
@ -659,7 +659,7 @@ private:
return true;
}
bool executeString(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeString(Block & block, const ColumnNumbers & arguments, size_t result) const
{
const ColumnArray * col_array = checkAndGetColumn<ColumnArray>(block.getByPosition(arguments[0]).column.get());
@ -725,7 +725,7 @@ private:
return true;
}
bool executeConst(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeConst(Block & block, const ColumnNumbers & arguments, size_t result) const
{
const ColumnConst * col_array = checkAndGetColumnConst<ColumnArray>(block.getByPosition(arguments[0]).column.get());
@ -801,7 +801,7 @@ private:
return true;
}
bool executeGeneric(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeGeneric(Block & block, const ColumnNumbers & arguments, size_t result) const
{
const ColumnArray * col_array = checkAndGetColumn<ColumnArray>(block.getByPosition(arguments[0]).column.get());
@ -878,7 +878,7 @@ public:
return std::make_shared<DataTypeNumber<typename IndexConv::ResultType>>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
/// If one or both arguments passed to this function are nullable,
/// we create a new block that contains non-nullable arguments:
@ -985,7 +985,7 @@ public:
private:
/// Perform function on the given block. Internal version.
void perform(Block & block, const ColumnNumbers & arguments, size_t result)
void perform(Block & block, const ColumnNumbers & arguments, size_t result) const
{
if (!(executeNumber<UInt8>(block, arguments, result)
|| executeNumber<UInt16>(block, arguments, result)

View File

@ -48,7 +48,7 @@ public:
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
bool useDefaultImplementationForConstants() const override { return true; }
@ -384,7 +384,7 @@ FunctionArrayIntersect::UnpackedArrays FunctionArrayIntersect::prepareArrays(
return arrays;
}
void FunctionArrayIntersect::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
void FunctionArrayIntersect::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
const auto & return_type = block.getByPosition(result).type;
const auto * return_type_array = checkAndGetDataType<DataTypeArray>(return_type.get());

View File

@ -54,7 +54,7 @@ public:
return arr->getNestedType();
}
void executeImpl(Block &, const ColumnNumbers &, size_t, size_t /*input_rows_count*/) override
void executeImpl(Block &, const ColumnNumbers &, size_t, size_t /*input_rows_count*/) const override
{
throw Exception("Function " + getName() + " must not be executed directly.", ErrorCodes::FUNCTION_IS_SPECIAL);
}

View File

@ -38,7 +38,7 @@ public:
return arguments[0];
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto & return_type = block.getByPosition(result).type;

View File

@ -46,7 +46,7 @@ public:
return std::make_shared<DataTypeArray>(getLeastSupertype(types));
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto & return_type = block.getByPosition(result).type;

View File

@ -49,7 +49,7 @@ public:
DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
private:
/// lazy initialization in getReturnTypeImpl
@ -105,7 +105,7 @@ DataTypePtr FunctionArrayReduce::getReturnTypeImpl(const ColumnsWithTypeAndName
}
void FunctionArrayReduce::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
void FunctionArrayReduce::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
IAggregateFunction & agg_func = *aggregate_function;
std::unique_ptr<Arena> arena = std::make_unique<Arena>();

View File

@ -52,7 +52,7 @@ public:
DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
private:
/// lazy initialization in getReturnTypeImpl
@ -123,7 +123,7 @@ DataTypePtr FunctionArrayReduceInRanges::getReturnTypeImpl(const ColumnsWithType
}
void FunctionArrayReduceInRanges::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
void FunctionArrayReduceInRanges::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
IAggregateFunction & agg_func = *aggregate_function;
std::unique_ptr<Arena> arena = std::make_unique<Arena>();

View File

@ -63,7 +63,7 @@ public:
return std::make_shared<DataTypeArray>(getLeastSupertype({array_type->getNestedType(), arguments[2]}));
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto & return_type = block.getByPosition(result).type;

View File

@ -41,7 +41,7 @@ public:
return arguments[0];
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) const override;
private:
template <typename T>
@ -53,7 +53,7 @@ private:
};
void FunctionArrayReverse::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t)
void FunctionArrayReverse::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) const
{
const ColumnArray * array = checkAndGetColumn<ColumnArray>(block.getByPosition(arguments[0]).column.get());
if (!array)

View File

@ -31,7 +31,7 @@ private:
using ResultColumnType = ColumnVector<typename Method::ResultType>;
template <typename T>
bool executeNumber(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeNumber(Block & block, const ColumnNumbers & arguments, size_t result) const
{
return executeNumberNumber<T, UInt8>(block, arguments, result)
|| executeNumberNumber<T, UInt16>(block, arguments, result)
@ -47,7 +47,7 @@ private:
template <typename T, typename U>
bool executeNumberNumber(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeNumberNumber(Block & block, const ColumnNumbers & arguments, size_t result) const
{
ColumnPtr col1 = block.getByPosition(arguments[0]).column->convertToFullColumnIfConst();
ColumnPtr col2 = block.getByPosition(arguments[1]).column->convertToFullColumnIfConst();
@ -123,7 +123,7 @@ public:
return Method::getReturnType(nested_types[0], nested_types[1]);
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /* input_rows_count */) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /* input_rows_count */) const override
{
if (!(executeNumber<UInt8>(block, arguments, result)
|| executeNumber<UInt16>(block, arguments, result)

View File

@ -69,7 +69,7 @@ public:
return arguments[0];
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto & return_type = block.getByPosition(result).type;

View File

@ -57,7 +57,7 @@ public:
return std::make_shared<DataTypeUInt32>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
private:
/// Initially allocate a piece of memory for 512 elements. NOTE: This is just a guess.
@ -106,22 +106,22 @@ private:
template <typename Method>
void executeMethod(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, const Sizes & key_sizes,
const NullMap * null_map, ColumnUInt32::Container & res_values);
const NullMap * null_map, ColumnUInt32::Container & res_values) const;
template <typename Method, bool has_null_map>
void executeMethodImpl(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, const Sizes & key_sizes,
const NullMap * null_map, ColumnUInt32::Container & res_values);
const NullMap * null_map, ColumnUInt32::Container & res_values) const;
template <typename T>
bool executeNumber(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values);
bool executeString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values);
bool executeFixedString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values);
bool execute128bit(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, ColumnUInt32::Container & res_values);
void executeHashed(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, ColumnUInt32::Container & res_values);
bool executeNumber(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const;
bool executeString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const;
bool executeFixedString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const;
bool execute128bit(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, ColumnUInt32::Container & res_values) const;
void executeHashed(const ColumnArray::Offsets & offsets, const ColumnRawPtrs & columns, ColumnUInt32::Container & res_values) const;
};
void FunctionArrayUniq::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/)
void FunctionArrayUniq::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const
{
const ColumnArray::Offsets * offsets = nullptr;
const size_t num_arguments = arguments.size();
@ -205,7 +205,7 @@ void FunctionArrayUniq::executeMethodImpl(
const ColumnRawPtrs & columns,
const Sizes & key_sizes,
[[maybe_unused]] const NullMap * null_map,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
typename Method::Set set;
typename Method::Method method(columns, key_sizes, nullptr);
@ -242,7 +242,7 @@ void FunctionArrayUniq::executeMethod(
const ColumnRawPtrs & columns,
const Sizes & key_sizes,
const NullMap * null_map,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
if (null_map)
executeMethodImpl<Method, true>(offsets, columns, key_sizes, null_map, res_values);
@ -252,7 +252,7 @@ void FunctionArrayUniq::executeMethod(
}
template <typename T>
bool FunctionArrayUniq::executeNumber(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values)
bool FunctionArrayUniq::executeNumber(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const
{
const auto * nested = checkAndGetColumn<ColumnVector<T>>(&data);
if (!nested)
@ -262,7 +262,7 @@ bool FunctionArrayUniq::executeNumber(const ColumnArray::Offsets & offsets, cons
return true;
}
bool FunctionArrayUniq::executeString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values)
bool FunctionArrayUniq::executeString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const
{
const auto * nested = checkAndGetColumn<ColumnString>(&data);
if (nested)
@ -271,7 +271,7 @@ bool FunctionArrayUniq::executeString(const ColumnArray::Offsets & offsets, cons
return nested;
}
bool FunctionArrayUniq::executeFixedString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values)
bool FunctionArrayUniq::executeFixedString(const ColumnArray::Offsets & offsets, const IColumn & data, const NullMap * null_map, ColumnUInt32::Container & res_values) const
{
const auto * nested = checkAndGetColumn<ColumnFixedString>(&data);
if (nested)
@ -283,7 +283,7 @@ bool FunctionArrayUniq::executeFixedString(const ColumnArray::Offsets & offsets,
bool FunctionArrayUniq::execute128bit(
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
size_t count = columns.size();
size_t keys_bytes = 0;
@ -307,7 +307,7 @@ bool FunctionArrayUniq::execute128bit(
void FunctionArrayUniq::executeHashed(
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
ColumnUInt32::Container & res_values)
ColumnUInt32::Container & res_values) const
{
executeMethod<MethodHashed>(offsets, columns, {}, nullptr, res_values);
}

View File

@ -47,7 +47,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
bool useDefaultImplementationForNulls() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t num_rows) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t num_rows) const override
{
const auto * col_num = block.getByPosition(arguments[0]).column.get();
const auto * col_value = block.getByPosition(arguments[1]).column.get();

View File

@ -55,7 +55,7 @@ public:
return std::make_shared<DataTypeArray>(std::make_shared<DataTypeTuple>(arguments_types));
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
size_t num_arguments = arguments.size();

View File

@ -44,7 +44,7 @@ private:
return std::make_shared<DataTypeArray>(std::make_shared<DataType>());
}
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
using UnderlyingColumnType = typename TypeToColumnType<typename DataType::FieldType>::ColumnType;

View File

@ -45,7 +45,7 @@ public:
return arguments[0];
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override;
};
@ -369,7 +369,7 @@ namespace
}
void FunctionEmptyArrayToSingle::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count)
void FunctionEmptyArrayToSingle::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const
{
if (FunctionEmptyArrayToSingleImpl::executeConst(block, arguments, result, input_rows_count))
return;

View File

@ -48,7 +48,7 @@ public:
return std::make_shared<DataTypeUInt8>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
size_t rows = input_rows_count;
size_t num_args = arguments.size();

View File

@ -57,7 +57,7 @@ private:
}
template <typename T>
bool executeInternal(Block & block, const IColumn * arg, const size_t result)
bool executeInternal(Block & block, const IColumn * arg, const size_t result) const
{
if (const auto in = checkAndGetColumn<ColumnVector<T>>(arg))
{
@ -102,7 +102,7 @@ private:
}
template <typename T>
bool executeConstStartStep(Block & block, const IColumn * end_arg, const T start, const T step, const size_t input_rows_count, const size_t result)
bool executeConstStartStep(Block & block, const IColumn * end_arg, const T start, const T step, const size_t input_rows_count, const size_t result) const
{
auto end_column = checkAndGetColumn<ColumnVector<T>>(end_arg);
if (!end_column)
@ -155,7 +155,7 @@ private:
}
template <typename T>
bool executeConstStep(Block & block, const IColumn * start_arg, const IColumn * end_arg, const T step, const size_t input_rows_count, const size_t result)
bool executeConstStep(Block & block, const IColumn * start_arg, const IColumn * end_arg, const T step, const size_t input_rows_count, const size_t result) const
{
auto start_column = checkAndGetColumn<ColumnVector<T>>(start_arg);
auto end_column = checkAndGetColumn<ColumnVector<T>>(end_arg);
@ -210,7 +210,7 @@ private:
}
template <typename T>
bool executeConstStart(Block & block, const IColumn * end_arg, const IColumn * step_arg, const T start, const size_t input_rows_count, const size_t result)
bool executeConstStart(Block & block, const IColumn * end_arg, const IColumn * step_arg, const T start, const size_t input_rows_count, const size_t result) const
{
auto end_column = checkAndGetColumn<ColumnVector<T>>(end_arg);
auto step_column = checkAndGetColumn<ColumnVector<T>>(step_arg);
@ -265,7 +265,7 @@ private:
}
template <typename T>
bool executeGeneric(Block & block, const IColumn * start_col, const IColumn * end_col, const IColumn * step_col, const size_t input_rows_count, const size_t result)
bool executeGeneric(Block & block, const IColumn * start_col, const IColumn * end_col, const IColumn * step_col, const size_t input_rows_count, const size_t result) const
{
auto start_column = checkAndGetColumn<ColumnVector<T>>(start_col);
auto end_column = checkAndGetColumn<ColumnVector<T>>(end_col);
@ -322,7 +322,7 @@ private:
return true;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
if (arguments.size() == 1)
{

View File

@ -38,7 +38,7 @@ public:
return removeNullable(arguments[0]);
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t) const override
{
const ColumnPtr & col = block.getByPosition(arguments[0]).column;
ColumnPtr & res_col = block.getByPosition(result).column;

View File

@ -65,7 +65,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1, 2, 3}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
Int64 min = extractConstant<Int64>(block, arguments, 1, "Second"); /// The level at which the line has zero length.
Int64 max = extractConstant<Int64>(block, arguments, 2, "Third"); /// The level at which the line has the maximum length.

View File

@ -12,7 +12,7 @@ namespace DB
class FunctionBlockNumber : public IFunction
{
private:
std::atomic<size_t> block_number{0};
mutable std::atomic<size_t> block_number{0};
public:
static constexpr auto name = "blockNumber";
@ -49,7 +49,7 @@ public:
return std::make_shared<DataTypeUInt64>();
}
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
size_t current_block_number = block_number++;
block.getByPosition(result).column = ColumnUInt64::create(input_rows_count, current_block_number);

View File

@ -28,7 +28,7 @@ public:
return std::make_shared<DataTypeUInt64>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
UInt64 size = 0;

View File

@ -41,7 +41,7 @@ public:
return std::make_shared<DataTypeUInt64>();
}
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
block.getByPosition(result).column = ColumnUInt64::create(input_rows_count, input_rows_count);
}

View File

@ -36,7 +36,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
block.getByPosition(result).column = DataTypeString().createColumnConst(input_rows_count, SymbolIndex::instance().getBuildIDHex());
}

View File

@ -43,7 +43,7 @@ public:
return getLeastSupertype(dst_array_types);
}
void executeImpl(Block & block, const ColumnNumbers & args, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & args, size_t result, size_t input_rows_count) const override
{
if (args.empty())
throw Exception{"Function " + getName() + " expects at least 1 argument",

View File

@ -85,7 +85,7 @@ public:
return res;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
/// coalesce(arg0, arg1, ..., argN) is essentially
/// multiIf(isNotNull(arg0), assumeNotNull(arg0), isNotNull(arg1), assumeNotNull(arg1), ..., argN)

View File

@ -71,7 +71,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
/// Format function is not proven to be faster for two arguments.
/// Actually there is overhead of 2 to 5 extra instructions for each string for checking empty strings in FormatImpl.
@ -86,7 +86,7 @@ public:
private:
const Context & context;
void executeBinary(Block & block, const ColumnNumbers & arguments, const size_t result, size_t input_rows_count)
void executeBinary(Block & block, const ColumnNumbers & arguments, const size_t result, size_t input_rows_count) const
{
const IColumn * c0 = block.getByPosition(arguments[0]).column.get();
const IColumn * c1 = block.getByPosition(arguments[1]).column.get();
@ -114,7 +114,7 @@ private:
block.getByPosition(result).column = std::move(c_res);
}
void executeFormatImpl(Block & block, const ColumnNumbers & arguments, const size_t result, size_t input_rows_count)
void executeFormatImpl(Block & block, const ColumnNumbers & arguments, const size_t result, size_t input_rows_count) const
{
const size_t num_arguments = arguments.size();
assert(num_arguments >= 2);

View File

@ -182,7 +182,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1, 2}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
const ColumnWithTypeAndName & arg_from = block.getByPosition(arguments[0]);
const ColumnWithTypeAndName & arg_charset_from = block.getByPosition(arguments[1]);

View File

@ -39,7 +39,7 @@ public:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
block.getByPosition(result).column = DataTypeString().createColumnConst(input_rows_count, db_name);
}

View File

@ -39,7 +39,7 @@ public:
bool isDeterministic() const override { return false; }
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
block.getByPosition(result).column = DataTypeString().createColumnConst(input_rows_count, user_name);
}

View File

@ -80,7 +80,7 @@ public:
bool useDefaultImplementationForConstants() const override { return true; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {0, 3}; }
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto * unit_column = checkAndGetColumnConst<ColumnString>(block.getByPosition(arguments[0]).column.get());
if (!unit_column)
@ -124,7 +124,7 @@ private:
void dispatchForColumns(
const IColumn & x, const IColumn & y,
const DateLUTImpl & timezone_x, const DateLUTImpl & timezone_y,
ColumnInt64::Container & result)
ColumnInt64::Container & result) const
{
if (const auto * x_vec_16 = checkAndGetColumn<ColumnUInt16>(&x))
dispatchForSecondColumn<Transform>(*x_vec_16, y, timezone_x, timezone_y, result);
@ -142,7 +142,7 @@ private:
void dispatchForSecondColumn(
const ColumnVector<T1> & x, const IColumn & y,
const DateLUTImpl & timezone_x, const DateLUTImpl & timezone_y,
ColumnInt64::Container & result)
ColumnInt64::Container & result) const
{
if (const auto * y_vec_16 = checkAndGetColumn<ColumnUInt16>(&y))
vectorVector<Transform>(x, *y_vec_16, timezone_x, timezone_y, result);
@ -160,7 +160,7 @@ private:
void dispatchConstForSecondColumn(
T1 x, const IColumn & y,
const DateLUTImpl & timezone_x, const DateLUTImpl & timezone_y,
ColumnInt64::Container & result)
ColumnInt64::Container & result) const
{
if (const auto * y_vec_16 = checkAndGetColumn<ColumnUInt16>(&y))
constantVector<Transform>(x, *y_vec_16, timezone_x, timezone_y, result);
@ -174,7 +174,7 @@ private:
void vectorVector(
const ColumnVector<T1> & x, const ColumnVector<T2> & y,
const DateLUTImpl & timezone_x, const DateLUTImpl & timezone_y,
ColumnInt64::Container & result)
ColumnInt64::Container & result) const
{
const auto & x_data = x.getData();
const auto & y_data = y.getData();
@ -186,7 +186,7 @@ private:
void vectorConstant(
const ColumnVector<T1> & x, T2 y,
const DateLUTImpl & timezone_x, const DateLUTImpl & timezone_y,
ColumnInt64::Container & result)
ColumnInt64::Container & result) const
{
const auto & x_data = x.getData();
for (size_t i = 0, size = x.size(); i < size; ++i)
@ -197,7 +197,7 @@ private:
void constantVector(
T1 x, const ColumnVector<T2> & y,
const DateLUTImpl & timezone_x, const DateLUTImpl & timezone_y,
ColumnInt64::Container & result)
ColumnInt64::Container & result) const
{
const auto & y_data = y.getData();
for (size_t i = 0, size = y.size(); i < size; ++i)
@ -205,7 +205,7 @@ private:
}
template <typename Transform, typename T1, typename T2>
Int64 calculate(T1 x, T2 y, const DateLUTImpl & timezone_x, const DateLUTImpl & timezone_y)
Int64 calculate(T1 x, T2 y, const DateLUTImpl & timezone_x, const DateLUTImpl & timezone_y) const
{
return Int64(Transform::execute(y, timezone_y))
- Int64(Transform::execute(x, timezone_x));

View File

@ -34,7 +34,7 @@ public:
return arguments[0];
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const IDataType & type = *block.getByPosition(arguments[0]).type;
block.getByPosition(result).column = type.createColumnConst(input_rows_count, type.getDefault());

View File

@ -60,7 +60,7 @@ public:
return true;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const ColumnPtr & column = block.getByPosition(arguments[0]).column;
const ColumnString * column_concrete = checkAndGetColumn<ColumnString>(column.get());

View File

@ -34,7 +34,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const auto & elem = block.getByPosition(arguments[0]);

View File

@ -16,7 +16,7 @@ void registerFunctionEquals(FunctionFactory & factory)
template <>
void FunctionComparison<EqualsOp, NameEquals>::executeTupleImpl(Block & block, size_t result, const ColumnsWithTypeAndName & x,
const ColumnsWithTypeAndName & y, size_t tuple_size,
size_t input_rows_count)
size_t input_rows_count) const
{
return executeTupleEqualityImpl(
FunctionFactory::instance().get("equals", context),

View File

@ -65,7 +65,7 @@ public:
return type->getReturnTypeToPredict();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
if (arguments.empty())
throw Exception("Function " + getName() + " requires at least one argument", ErrorCodes::BAD_ARGUMENTS);

View File

@ -69,7 +69,7 @@ public:
return std::make_shared<DataTypeArray>(std::make_shared<DataTypeArray>(std::make_shared<DataTypeString>()));
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
static const auto MAX_GROUPS_COUNT = 128;

View File

@ -51,7 +51,7 @@ public:
return std::make_shared<DataTypeArray>(std::make_shared<DataTypeString>());
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const ColumnPtr column_haystack = block.getByPosition(arguments[0]).column;
const ColumnPtr column_needle = block.getByPosition(arguments[1]).column;

View File

@ -11,19 +11,19 @@ namespace DB
struct FilesystemAvailable
{
static constexpr auto name = "filesystemAvailable";
static std::uintmax_t get(std::filesystem::space_info & spaceinfo) { return spaceinfo.available; }
static std::uintmax_t get(const std::filesystem::space_info & spaceinfo) { return spaceinfo.available; }
};
struct FilesystemFree
{
static constexpr auto name = "filesystemFree";
static std::uintmax_t get(std::filesystem::space_info & spaceinfo) { return spaceinfo.free; }
static std::uintmax_t get(const std::filesystem::space_info & spaceinfo) { return spaceinfo.free; }
};
struct FilesystemCapacity
{
static constexpr auto name = "filesystemCapacity";
static std::uintmax_t get(std::filesystem::space_info & spaceinfo) { return spaceinfo.capacity; }
static std::uintmax_t get(const std::filesystem::space_info & spaceinfo) { return spaceinfo.capacity; }
};
template <typename Impl>
@ -48,7 +48,7 @@ public:
return std::make_shared<DataTypeUInt64>();
}
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
{
block.getByPosition(result).column = DataTypeUInt64().createColumnConst(input_rows_count, static_cast<UInt64>(Impl::get(spaceinfo)));
}

View File

@ -58,7 +58,7 @@ public:
return type->getReturnType();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
auto column = block.getByPosition(arguments.at(0)).column;
if (!typeid_cast<const ColumnAggregateFunction *>(column.get()))

View File

@ -292,7 +292,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) const override
{
if (!executeType<DataTypeDate>(block, arguments, result)
&& !executeType<DataTypeDateTime>(block, arguments, result)
@ -303,7 +303,7 @@ public:
}
template <typename DataType>
bool executeType(Block & block, const ColumnNumbers & arguments, size_t result)
bool executeType(Block & block, const ColumnNumbers & arguments, size_t result) const
{
auto * times = checkAndGetColumn<typename DataType::ColumnType>(block.getByPosition(arguments[0]).column.get());
if (!times)

View File

@ -64,7 +64,7 @@ public:
return std::make_shared<DataTypeString>();
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) const override
{
const ColumnPtr & c0 = block.getByPosition(arguments[0]).column;
const ColumnConst * c0_const_string = typeid_cast<const ColumnConst *>(&*c0);

Some files were not shown because too many files have changed in this diff Show More