You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the query select count(distinct c1), count(distinct c2) from t0 having count(1) > 0, when CTE optimization is close, low-cardinality dict optimization is open and two-stage aggregation is adopted, A wrong plan will be generated, a DecodeNode wedges into two-stage Agg whose agg function is multi_distinct_count. The 1st agg(below DecodeNode) aggregates dict-encoding input data into Set and serialize it then send it to 2nd agg, the 2nd agg(above DecodeNode) deserializes the data and treat it as Set, this fact causes be crashes.
The root cause is that 1st agg is rewritten before 2nd agg when apply dict optimization, however 2nd agg fails to be rewritten because it has having-clausing that references some aggregation, so dict optimization can not propagates upwards and DecodeNode is interpolated between two aggs.
For the query select count(distinct c1), count(distinct c2) from t0 having count(1) > 0, when CTE optimization is close, low-cardinality dict optimization is open and two-stage aggregation is adopted, A wrong plan will be generated, a DecodeNode wedges into two-stage Agg whose agg function is multi_distinct_count. The 1st agg(below DecodeNode) aggregates dict-encoding input data into Set and serialize it then send it to 2nd agg, the 2nd agg(above DecodeNode) deserializes the data and treat it as Set, this fact causes be crashes.
The root cause is that 1st agg is rewritten before 2nd agg when apply dict optimization, however 2nd agg fails to be rewritten because it has having-clausing that references some aggregation, so dict optimization can not propagates upwards and DecodeNode is interpolated between two aggs.
Steps to reproduce the behavior (Required)
preprare data
query
Expected behavior (Required)
no DecodeNode interpolated
Real behavior (Required)
DecodeNode interpolated
StarRocks version (Required)
The text was updated successfully, but these errors were encountered: