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

   ## Which issue does this PR close?
   
   - Closes #26363.
   
   ## Rationale for this change
   
   With `enable_piecewise_merge_join = true`, EXISTS / NOT EXISTS / RIGHT SEMI 
/ RIGHT ANTI joins with a range predicate fail on a run-end encoded key 
("Min/Max accumulator not implemented for type RunEndEncoded"). The existence 
paths reduce each key batch with `extreme_key`, which calls 
`min_batch`/`max_batch`, and those have no run-end encoded case.
   
   ## What changes are included in this PR?
   
   `extreme_key` reduces the run values inside the array’s slice and wraps the 
result in a one-row run-end encoded array, so it keeps the key’s type. 
`min_batch`/`max_batch` are unchanged, because the MIN/MAX aggregates already 
cast REE input in the planner.
   
   ## Are these changes tested?
   
   New `pwmj.slt` cases for all four join types with `<` and `>` plus an 
EXPLAIN. Expected rows are what the same queries return with the flag off. A 
unit test for `extreme_key` covers a sliced array, min and max, re-reducing 
combined keys, NULL-only and empty input, and Int64 run ends. All of them fail 
without the change.
   
   ## Are there any user-facing changes?
   
   These queries return rows instead of an internal error.
   
   Code drafted by both human and AI, and reviewed by human.
   


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