Fix bug for quantile fusion

This commit is contained in:
hexiaoting 2021-10-11 10:39:55 +08:00
parent 5a7f30171a
commit aabe52e3e9
3 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,7 @@ void GatherFunctionQuantileData::visit(ASTFunction & function, ASTPtr & ast)
void GatherFunctionQuantileData::FuseQuantileAggregatesData::addFuncNode(ASTPtr & ast) void GatherFunctionQuantileData::FuseQuantileAggregatesData::addFuncNode(ASTPtr & ast)
{ {
const auto * func = ast->as<ASTFunction>(); const auto * func = ast->as<ASTFunction>();
if (!func) if (!func || func->parameters == nullptr)
return; return;
const auto & arguments = func->arguments->children; const auto & arguments = func->arguments->children;

View File

@ -95,3 +95,4 @@ FROM
FROM numbers(10) FROM numbers(10)
) )
GROUP BY b GROUP BY b
1 1 1

View File

@ -71,3 +71,6 @@ SELECT quantileTimingWeighted([[[[['-214748364.8'], NULL]], [[[quantileTimingWei
SELECT quantileTimingWeighted([quantileTimingWeighted(0.5)(1, 1)])(1, 1); -- { serverError ILLEGAL_AGGREGATION } SELECT quantileTimingWeighted([quantileTimingWeighted(0.5)(1, 1)])(1, 1); -- { serverError ILLEGAL_AGGREGATION }
DROP TABLE datetime; DROP TABLE datetime;
SET optimize_syntax_fuse_functions = 1;
SELECT quantile(1 AS a), quantile(a AS b), quantile(b AS c);