LiBinfeng-01 opened a new pull request, #22196:
URL: https://github.com/apache/doris/pull/22196

   ## 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.
   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 
[d...@doris.apache.org](mailto:d...@doris.apache.org) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to