-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The header of group by is incorrect #538
Comments
Now it will panic with:
🤪 |
Despite the above issue, let's fix an easier one. Case 1
which will produce:
Case 2create table t2 (c1 int, c2 int);
insert into t2 values (0, 1), (1, 2);
select c1 + c2 from t2 group by c1 + c2; which yields:
(should be Basically, this is a problem with schema. The derived schema is incorrect for logical aggregate.
L78 directly used child schema, which is
while this executor will only output one column. So we will need to rewrite the whole scheme derivation process. It should be as simple as:
Where we need to derive a schema for arbitrary expression. We can simply use |
cc @shmiwy would you please have a try? |
It seems that we can't compose a ColumnDesc simply use create table t(c1 int, c2 int, c3 int, c4 int);
insert into t values (0,1,2,3), (1,2,3,4), (2,3,4,5);
select c1 + c2, c3 + c4 from t group by c1 + c2, c3 + c4; the logical_plan created by this line Line 190 in bcbe568
shows like this
when we get column_names,
to corresponding form(maybe we can get form from self.group_keys) |
Yes, exactly! You can find out how to generate |
For the first step, we can keep it simple -- if the |
* executor: use DataChunkbuilder to refactor ValuesExecutor (#623) * use DataChunkbuilder to refactor ValuesExecutor Signed-off-by: Jayice <1185430411@qq.com> * code format Signed-off-by: Jayice <1185430411@qq.com> * code style Signed-off-by: Jayice <1185430411@qq.com> Signed-off-by: Shmiwy <wyf000219@126.com> * fix: make header correct when using group by(#538) Signed-off-by: Shmiwy <wyf000219@126.com> * fix: map group_keys to ColumnDesc Signed-off-by: Shmiwy wyf000219@gamil.com Signed-off-by: Shmiwy <wyf000219@126.com> * fix: use expr's return type instead of child schema's Signed-off-by: Shmiwy wyf000219@gamil.com Signed-off-by: Shmiwy <wyf000219@126.com> * build: bump toolchain and deps, remove unused dep (#629) Signed-off-by: TennyZhuang <zty0826@gmail.com> Signed-off-by: Shmiwy <wyf000219@126.com> Co-authored-by: JAYICE <49588871+JayiceZ@users.noreply.github.com> Co-authored-by: TennyZhuang <zty0826@gmail.com>
The header is incorrect
Originally posted by @xxchan in #535 (comment)
The text was updated successfully, but these errors were encountered: