devampatel03 opened a new pull request, #17690:
URL: https://github.com/apache/datafusion/pull/17690

   ## Which issue does this PR close?
   
   Closes #17469
   
   ## Rationale for this change
   
   Fixes confusing behavior where calling a function by an alias (e.g., 
`date_format`) would display the underlying function's name (e.g., `to_char`) 
in the output column. This change makes the output column name match the alias 
used in the query, improving user experience.
   
   ## What changes are included in this PR?
   
   The SQL planner (`function.rs`) is modified to create a general solution 
that works for any function alias. When an alias is found, it now constructs a 
verbose name including the alias and its arguments (e.g., `date_format(col1, 
col2)`) and uses that as the output column name. This change applies to both 
scalar and aggregate functions.
   
   ## Are these changes tested?
   
   Yes. The example test for `date_format` was updated to assert the new, 
correct output. The generality of the fix was also confirmed with the `substr` 
alias. 
   
   ## Are there any user-facing changes?
   
   Yes.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to