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

   ## Which issue does this PR close?
   
   Closes #11981 
   
   ## Rationale for this change
   
   When performing a window function using a UDAF, which all of our aggregate 
functions are, causes an error in the physical plan. Specifically it generates 
a `SchemaError::FieldNotFound`. This *appears* to be because the `DFSchema` is 
empty in the minimal example showing in the bug report. However the ordering 
operation appears to already be handled by the window function call.
   
   ## What changes are included in this PR?
   
   Removes the generation of the ordering and sorting, which are essentially 
duplicates of each other, and only leaves the ordering parameters on the window 
function definition.
   
   ## Are these changes tested?
   
   All unit tests working.
   The minimum demonstration of the error in the bug report now works.
   Tested against my project where I initially discovered the problem.
   
   ## Are there any user-facing changes?
   
   None.
   
   ## Additional Context
   
   I must admit I don't fully understand the rationale behind setting the 
ordering/sort parameters on both the window function definition and also within 
the aggregate function. So this code change does resolve my immediate issue, 
but I am not 100% confident it will not have unintended side effects.
   


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