yyy1000 commented on PR #10417:
URL: https://github.com/apache/datafusion/pull/10417#issuecomment-2099690126

   It's good now. @jayzhan211 You can review it when you are available. :)
   In this example 
https://github.com/apache/datafusion/blob/96487ea0cbb7901a1e4aa18fdf6deb8961319fea/datafusion/core/tests/user_defined/user_defined_aggregates.rs#L165-L176,
 after `apply_function_rewrites`, the logical plan would not create an alias 
because the `display_name` of `get_field` is the same as `sq.first[value]`
   
   In this PR:
   "| initial_logical_plan                                       | Projection: 
(sq.first)[value], (sq.first)[time]                                             
                                                                                
                                            |",
       "|                                                            |   
SubqueryAlias: sq                                                               
                                                                                
                                                      |",
       "|                                                            |     
Projection: first(t.value,t.time) AS first                                      
                                                                                
                                                    |",
       "|                                                            |       
Aggregate: groupBy=[[]], aggr=[[first(t.value, t.time)]]                        
                                                                                
                                                  |",
       "|                                                            |         
TableScan: t                                                                    
                                                                                
                                                |",
       "| logical_plan after apply_function_rewrites                 | 
Projection: get_field(sq.first, Utf8(\"value\")), get_field(sq.first, 
Utf8(\"time\"))                                                                 
                                                                      |",
       "|                                                            |   
SubqueryAlias: sq                                                               
                                                                                
                                                      |",
       "|                                                            |     
Projection: first(t.value,t.time) AS first                                      
                                                                                
                                                    |",
       "|                                                            |       
Aggregate: groupBy=[[]], aggr=[[first(t.value, t.time)]]                        
                                                                                
                                                  |",
       "|                                                            |         
TableScan: t                                                                    
                                                                                
                                                |",
   
   
   Before this PR:
   "| initial_logical_plan                                       | Projection: 
(sq.first)[value], (sq.first)[time]                                             
                                                                                
                                            |",
       "|                                                            |   
SubqueryAlias: sq                                                               
                                                                                
                                                      |",
       "|                                                            |     
Projection: first(t.value,t.time) AS first                                      
                                                                                
                                                    |",
       "|                                                            |       
Aggregate: groupBy=[[]], aggr=[[first(t.value, t.time)]]                        
                                                                                
                                                  |",
       "|                                                            |         
TableScan: t                                                                    
                                                                                
                                                |",
       "| logical_plan after apply_function_rewrites                 | 
Projection: get_field(sq.first, Utf8(\"value\")) AS sq.first[value], 
get_field(sq.first, Utf8(\"time\")) AS sq.first[time]                           
                                                                       |",
       "|                                                            |   
SubqueryAlias: sq                                                               
                                                                                
                                                      |",
       "|                                                            |     
Projection: first(t.value,t.time) AS first                                      
                                                                                
                                                    |",
       "|                                                            |       
Aggregate: groupBy=[[]], aggr=[[first(t.value, t.time)]]                        
                                                                                
                                                  |",
       "|                                                            |         
TableScan: t                                                                    
                                                                                
                                                |",
       "| logical_plan after inline_table_scan                       | SAME 
TEXT AS ABOVE


-- 
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: github-unsubscr...@datafusion.apache.org

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


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

Reply via email to