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
createtablet (a int, b int, c int, primary key (a, b, c));
insert into t values (1, 1, 1), (1, 2, 3), (1, 3, 1);
selectcount(*) from t group by a, c; -- correctselect a, c, count(*) from t group by a, c; -- correctselect a, c, first_value(b order by b), count(*) from t group by a, c; -- correctselect a, c, first_value(b order by b), count(*) from t group by a, c having a =1; -- incorrect!!!
It seems that the LogicalAgg is wrongly converted to BatchSortAgg when group by column is a non-continuous subset of table pk (input order), and when having clause is added, the optimizer generates a local batch plan without the BatchSort before Exchange.
Expected behavior
No response
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
No response
Error message/log
No response
To Reproduce
Explain messages of the last two queries above:
It seems that the
LogicalAgg
is wrongly converted toBatchSortAgg
when group by column is a non-continuous subset of table pk (input order), and whenhaving
clause is added, the optimizer generates a local batch plan without theBatchSort
beforeExchange
.Expected behavior
No response
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: