-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Fix](Planner) fix parse error of view with group_concat order by #22196
Conversation
run buildall |
(From new machine)TeamCity pipeline, clickbench performance test result: |
run build all |
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
e496e0d
to
93a960f
Compare
run buildall |
(From new machine)TeamCity pipeline, clickbench performance test result: |
(From new machine)TeamCity pipeline, clickbench performance test result: |
7ca6de2
93a960f
to
7ca6de2
Compare
run buildall |
7ca6de2
to
f4bc99d
Compare
run buildall |
f4bc99d
to
2924030
Compare
run buildall |
(From new machine)TeamCity pipeline, clickbench performance test result: |
2924030
to
d4f4697
Compare
run buildall |
(From new machine)TeamCity pipeline, clickbench performance test result: |
run buildall |
(From new machine)TeamCity pipeline, clickbench performance test result: |
run feut |
PR approved by at least one committer and no changes requested. |
…ache#22196) Problem: When create view with projection group_concat(xxx, xxx order by orderkey). It will failed during second parse of inline view For example: it works when doing "SELECT id, group_concat(`name`, "," ORDER BY id) AS test_group_column FROM test GROUP BY id" but when create view it does not work "create view test_view as SELECT id, group_concat(`name`, "," ORDER BY id) AS test_group_column FROM test GROUP BY id" Reason: when creating view, we will doing parse again of view.toSql() to check whether it has some syntax error. And when doing toSql() to group_concat with order by, it add seperate ', ' between second parameter and order by. So when parsing again, it would failed because it is different semantic with original statement. group_concat(`name`, "," ORDER BY id) ==> group_concat(`name`, "," , ORDER BY id) Solved: Change toSql of group_concat and add order by statement analyze() of group_concat in Planner cause it would work if we get order by from view statement and do not analyze and binding slot reference to it
…2530) cherry-pick from master master pr:#22196 commit id: 3a1d678 Problem: When create view with projection group_concat(xxx, xxx order by orderkey). It will failed during second parse of inline view For example: it works when doing "SELECT id, group_concat(`name`, "," ORDER BY id) AS test_group_column FROM test GROUP BY id" but when create view it does not work "create view test_view as SELECT id, group_concat(`name`, "," ORDER BY id) AS test_group_column FROM test GROUP BY id" Reason: when creating view, we will doing parse again of view.toSql() to check whether it has some syntax error. And when doing toSql() to group_concat with order by, it add seperate ', ' between second parameter and order by. So when parsing again, it would failed because it is different semantic with original statement. group_concat(`name`, "," ORDER BY id) ==> group_concat(`name`, "," , ORDER BY id) Solved: Change toSql of group_concat and add order by statement analyze() of group_concat in Planner cause it would work if we get order by from view statement and do not analyze and binding slot reference to it
Proposed changes
Problem:
When create view with projection group_concat(xxx, xxx order by orderkey). It will failed during second parse of inline view
For example:
it works when doing
"SELECT id, group_concat(
name
, "," ORDER BY id) AS test_group_column FROM test GROUP BY id"but when create view it does not work
"create view test_view as SELECT id, group_concat(
name
, "," ORDER BY id) AS test_group_column FROM test GROUP BY id"Reason:
when creating view, we will doing parse again of view.toSql() to check whether it has some syntax error. And when doing toSql() to group_concat with order by, it add seperate ', ' between second parameter and order by. So when parsing again, it
would failed because it is different semantic with original statement.
group_concat(
name
, "," ORDER BY id) ==> group_concat(name
, "," , ORDER BY id)Solved:
Change toSql of group_concat and add order by statement analyze() of group_concat in Planner cause it would work if we get order by from view statement and do not analyze and binding slot reference to it
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...