sunchao opened a new pull request, #7361:
URL: https://github.com/apache/datafusion-comet/pull/7361

   ## Which issue does this PR close?
   
   Part of #7189. This extends #7190.
   
   ## Rationale for this change
   
   For `l.id = coalesce(r.primary_id, r.backup_id)`, an unfiltered left-semi 
join only needs to know whether each resulting right-side ID exists. The native 
sort currently receives every right row, even when many rows produce the same 
ID.
   
   ## What changes are included in this PR?
   
   Allow the existing opt-in right-key reduction for one integer `coalesce` 
whose operands are columns or literals of the same type. A native projection 
computes the key below the right sort. The reducer, sort and join all read that 
projected column. The direct integer column path, left-side rows, row 
thresholds and memory admission rules are preserved.
   
   ## How are these changes tested?
   
   The Spark regression matches a left-side BIGINT only through a NULL 
replacement on the right, preserves repeated left rows, and checks that fewer 
rows reach the sort. The admission test also covers a cast inside `coalesce`. 
On the base revision the query returns the correct result but does not reduce 
the computed keys.
   
   Local focused tests and counterbalanced repeated-key and unique-key 
benchmarks are running.
   


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