jackwener commented on issue #4123:
URL: 
https://github.com/apache/arrow-datafusion/issues/4123#issuecomment-1306769870

   look like planner `sort` build wrong.
   
   ```sql
   create table foo as select 1 as a;
   select a from (select a from foo group by 1 order by a) as c;
   
   Projection: c.a
     Sort: foo.a ASC NULLS LAST
       Projection: foo.a, alias=c
         Aggregate: groupBy=[[foo.a]], aggr=[[]]
           TableScan: foo
   Projection: c.a
     Projection: c.a, alias=c
       Projection: c.a
         Sort: foo.a ASC NULLS LAST
           Projection: foo.a, alias=c
             Aggregate: groupBy=[[foo.a]], aggr=[[]]
               TableScan: foo
   ```
   
   we should `Sort: c.a` instead of `Sort: foo.a`


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to