mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-27 20:20:49 +00:00
Do not use inputs which values are known constants in ActionsDAG.
This commit is contained in:
parent
fd5adf1ff6
commit
998aed3029
@ -39,7 +39,17 @@ ActionsDAG::ActionsDAG(const ColumnsWithTypeAndName & inputs_)
|
||||
for (const auto & input : inputs_)
|
||||
{
|
||||
if (input.column && isColumnConst(*input.column))
|
||||
{
|
||||
addInput(input, true);
|
||||
|
||||
/// Here we also add column.
|
||||
/// It will allow to remove input which is actually constant (after projection).
|
||||
/// Also, some transforms from query pipeline may randomly materialize constants,
|
||||
/// without any respect to header structure. So, it is a way to drop materialized column and use
|
||||
/// constant value from header.
|
||||
/// We cannot remove such input right now cause inputs positions are important in some cases.
|
||||
addColumn(input, true);
|
||||
}
|
||||
else
|
||||
addInput(input.name, input.type, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user