mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
Revert "Materialize column in header for not isSuitableForConstantFolding"
This reverts commit 04afd6a3bfeb2c3f4d78a153056bb1217028f0cc.
This commit is contained in:
parent
e438eff93c
commit
e8422414b0
@ -539,16 +539,6 @@ static ColumnWithTypeAndName executeActionForHeader(const ActionsDAG::Node * nod
|
||||
case ActionsDAG::ActionType::FUNCTION:
|
||||
{
|
||||
res_column.column = node->function->execute(arguments, res_column.type, 0, true);
|
||||
/**
|
||||
* In header, we only need const columns if they are used for constant folding.
|
||||
* Constants in headers are used for query analysis and optimization.
|
||||
* Therefore, if the function is not suitable for constant folding, the constant shouldn't be in the header.
|
||||
* For example, function hostName() is not suitable for constant folding in distributed queries.
|
||||
* In the new analyzer, we'd like to have a non-constant hostName() in the header.
|
||||
* For the old analyzer, we take a header from DAG, and it's not constant because of a check inside ActionsDAG::addFunctionImpl.
|
||||
*/
|
||||
if (!node->function_base->isSuitableForConstantFolding() && res_column.column && isColumnConst(*res_column.column))
|
||||
res_column.column = res_column.column->convertToFullColumnIfConst();
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user