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

   ## Which issue does this PR close?
   
   No issue, but a bug from production
   
   ## Rationale for this change
   
   The unparser breaks a round trip on aggregates with a within group.
   
   I.e,
   
   ```sql
   SELECT approx_percentile_cont(0.9, 200) WITHIN GROUP (ORDER BY salary * 2 
DESC) FROM person
   ```
   
   Becomes:
   
   ```sql
   SELECT approx_percentile_cont((person.salary * 2), 0.9, 200) WITHIN GROUP 
(ORDER BY (person.salary * 2) DESC NULLS FIRST) FROM person
   ```
   
   This breaks things 
   
   
   ## What changes are included in this PR?
   
   Adds some structure to the unparser to basically unparse this correctly.
   
   ## Are these changes tested?
   
   Yes, a few test cases added
   
   ## Are there any user-facing changes?
   
   Nope
   


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