[fix](agg) incorrect result with having conjuncts and limit (#33040)
This commit is contained in:
@ -631,7 +631,8 @@ AggSinkOperatorX::AggSinkOperatorX(ObjectPool* pool, int operator_id, const TPla
|
||||
_is_first_phase(tnode.agg_node.__isset.is_first_phase && tnode.agg_node.is_first_phase),
|
||||
_pool(pool),
|
||||
_limit(tnode.limit),
|
||||
_have_conjuncts(tnode.__isset.vconjunct && !tnode.vconjunct.nodes.empty()),
|
||||
_have_conjuncts((tnode.__isset.vconjunct && !tnode.vconjunct.nodes.empty()) ||
|
||||
(tnode.__isset.conjuncts && !tnode.conjuncts.empty())),
|
||||
_partition_exprs(tnode.__isset.distribute_expr_lists ? tnode.distribute_expr_lists[0]
|
||||
: std::vector<TExpr> {}),
|
||||
_is_colocate(tnode.agg_node.__isset.is_colocate && tnode.agg_node.is_colocate) {}
|
||||
|
||||
@ -377,3 +377,5 @@ TESTING AGAIN
|
||||
-- !select_quantile_percent --
|
||||
5000.0
|
||||
|
||||
-- !having_with_limit --
|
||||
7 -32767.0
|
||||
|
||||
@ -343,4 +343,10 @@ suite("aggregate") {
|
||||
"""
|
||||
exception "aggregate function cannot contain aggregate parameters"
|
||||
}
|
||||
|
||||
sql " set parallel_pipeline_task_num = 1; "
|
||||
sql " set enable_pipeline_x_engine = 1; "
|
||||
qt_having_with_limit """
|
||||
select k1 as k, avg(k2) as k2 from tempbaseall group by k1 having k2 < -32765 limit 1;
|
||||
"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user