Annalyzer: limit maximal size of column in constant folding

This commit is contained in:
vdimir 2024-04-04 09:52:58 +00:00
parent d86eae3dd9
commit e516bef844
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862

View File

@ -6083,7 +6083,9 @@ ProjectionNames QueryAnalyzer::resolveFunction(QueryTreeNodePtr & node, Identifi
* Example: SELECT toTypeName(sum(number)) FROM numbers(10);
*/
if (column && isColumnConst(*column) && !typeid_cast<const ColumnConst *>(column.get())->getDataColumn().isDummy() &&
(!hasAggregateFunctionNodes(node) && !hasFunctionNode(node, "arrayJoin")))
!hasAggregateFunctionNodes(node) && !hasFunctionNode(node, "arrayJoin") &&
/// Sanity check: do not convert large columns to constants
column->byteSize() < 1_MiB)
{
/// Replace function node with result constant node
Field column_constant_value;