Open Lvnszn opened 1 year ago
I think this is a bug in the current sql->logical plan transform.
Right now it treats a query as a grouping if there's at least one aggregate function (so it works for whole-table aggregates).
This could be fixed to treat a query as a grouping if there's either at least on aggregate function, or at least one grouped-by field.
how do i fix this bug?
You can try to change the ParseSelect function in parser/parser.go
so that isGroupBy is true not only when there's an aggregate used, but when statement.GroupBy is non-empty.
the sql will return the same value in one column.