mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-25 11:10:49 +00:00
Minor changes
This commit is contained in:
parent
3ec2ab6156
commit
ab65b7f25d
@ -226,10 +226,9 @@ ColumnWithTypeAndName ColumnFunction::reduce() const
|
||||
if (is_short_circuit_argument)
|
||||
{
|
||||
/// Arguments of lazy executed function can also be lazy executed.
|
||||
const ColumnFunction * arg;
|
||||
for (auto & col : columns)
|
||||
{
|
||||
if ((arg = typeid_cast<const ColumnFunction *>(col.column.get())) && arg->isShortCircuitArgument())
|
||||
if (const ColumnFunction * arg = checkAndGetShortCircuitArgument(col.column))
|
||||
col = arg->reduce();
|
||||
}
|
||||
}
|
||||
@ -244,4 +243,12 @@ ColumnWithTypeAndName ColumnFunction::reduce() const
|
||||
return res;
|
||||
}
|
||||
|
||||
const ColumnFunction * checkAndGetShortCircuitArgument(const ColumnPtr & column)
|
||||
{
|
||||
const ColumnFunction * column_function;
|
||||
if ((column_function = typeid_cast<const ColumnFunction *>(column.get())) && column_function->isShortCircuitArgument())
|
||||
return column_function;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -173,6 +173,10 @@ private:
|
||||
bool is_function_compiled;
|
||||
|
||||
void appendArgument(const ColumnWithTypeAndName & column);
|
||||
|
||||
void addOffsetsForReplication(const IColumn::Offsets & offsets);
|
||||
};
|
||||
|
||||
const ColumnFunction * checkAndGetShortCircuitArgument(const ColumnPtr & column);
|
||||
|
||||
}
|
||||
|
@ -101,11 +101,6 @@ void expandOffsetsByMask(PaddedPODArray<UInt64> & offsets, const PaddedPODArray<
|
||||
throw Exception("Not enough bytes in mask", ErrorCodes::LOGICAL_ERROR);
|
||||
}
|
||||
|
||||
void expandColumnByMask(const ColumnPtr & column, const PaddedPODArray<UInt8>& mask, bool inverted)
|
||||
{
|
||||
column->assumeMutable()->expand(mask, inverted);
|
||||
}
|
||||
|
||||
MaskInfo getMaskFromColumn(
|
||||
const ColumnPtr & column,
|
||||
PaddedPODArray<UInt8> & res,
|
||||
@ -197,8 +192,8 @@ void inverseMask(PaddedPODArray<UInt8> & mask)
|
||||
|
||||
void maskedExecute(ColumnWithTypeAndName & column, const PaddedPODArray<UInt8> & mask, const MaskInfo & mask_info, bool inverted)
|
||||
{
|
||||
const auto * column_function = checkAndGetColumn<ColumnFunction>(*column.column);
|
||||
if (!column_function || !column_function->isShortCircuitArgument())
|
||||
const auto * column_function = checkAndGetShortCircuitArgument(column.column);
|
||||
if (!column_function)
|
||||
return;
|
||||
|
||||
ColumnWithTypeAndName result;
|
||||
@ -224,8 +219,8 @@ void maskedExecute(ColumnWithTypeAndName & column, const PaddedPODArray<UInt8> &
|
||||
|
||||
void executeColumnIfNeeded(ColumnWithTypeAndName & column, bool empty)
|
||||
{
|
||||
const auto * column_function = checkAndGetColumn<ColumnFunction>(*column.column);
|
||||
if (!column_function || !column_function->isShortCircuitArgument())
|
||||
const auto * column_function = checkAndGetShortCircuitArgument(column.column);
|
||||
if (!column_function)
|
||||
return;
|
||||
|
||||
if (!empty)
|
||||
|
Loading…
Reference in New Issue
Block a user