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

   ## Which issue does this PR close?
   
   - Closes #25766.
   
   ## Rationale for this change
   
   Window PARTITION BY treated 0.0 and -0.0 as different keys, unlike GROUP BY, 
DISTINCT, and joins. Normalizing only the partition boundaries is insufficient 
because the sort under the window still orders -0.0 before 0.0, potentially 
producing incorrect ordering within the combined partition.
   
   ## What changes are included in this PR?
   
   - Wrap partition keys containing floats, including nested floats, in 
NormalizeFloatZeroExpr during physical planning, so sorting, repartitioning, 
partition boundary detection, and cross-batch state use consistent keys.
   - Add protobuf serialization support for the new expression.
   
   ## Are these changes tested?
   
   Yes: SQL regression tests in negative_zero.slt, a protobuf round-trip test, 
and a cross-batch test for BoundedWindowAggExec.
   
   ## Are there any user-facing changes?
   
   Window functions now treat -0.0 and 0.0 as the same partition key. Original 
column values are preserved. EXPLAIN shows normalize_float_zero(...) in sort 
expressions for partition keys containing floats.
   
   ## AI assistance
   I used Claude and Codex for code exploration, implementation
   guidance, review, and documentation drafting. I applied the changes and ran
   the tests myself.


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