shehab-ali opened a new pull request, #24067:
URL: https://github.com/apache/datafusion/pull/24067

   ## Rationale for this change
   Hash-join key-equality verification (equal_rows_arr) checks every candidate 
row pair produced by a hash-bucket match. The current implementation calls 
JoinKeyComparator::is_equal per pair, which for each pair:
   1. invokes a boxed DynComparator closure (an un-inlinable indirect call)
   2. computes a full three-way Ordering, only to discard everything except 
equal / not-equal.
   
   For single-column, high-fanout joins with near-100% match rates (long string 
keys are the worst case), that per-pair overhead dominates the join and 
measurably regresses throughput relative to the previous vectorized approach.
   
   Benchmarking against main on the hj SQL benchmark suite (TPC-H SF10, 
interleaved runs to cancel drift) showed this cost concentrated in 
single-column-key queries — e.g. Q23 (a high-fanout ~28-char string key) ran 
~5% slower, with a cluster of other single/low-column joins 6–22% slower.
   
   ## What changes are included in this PR?
   * Add equal_rows_single_col: a specialized fast path for single-column join 
keys. It downcasts the key array once and runs a monomorphized == loop over the 
candidate pairs, eliminating the per-pair boxed-closure dispatch and the 
Ordering computation.
   * Covered types: integers, Decimal128, dates, timestamps, boolean, and all 
Utf8/Binary variants (incl. Utf8View/BinaryView).
   * Multi-column keys and unspecialized types fall through unchanged to the 
existing JoinKeyComparator path. Floats (Float16/32/64) are intentionally 
excluded so their -0.0/NaN equality semantics remain on the exact same code 
path as before.
   * Null handling is preserved: NullEqualsNothing → both-null is unequal; 
NullEqualsNull → both-null is equal.


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