Repository navigation
perf: reuse evaluated hash join build keys - #27285
Phoenix500526 wants to merge 1 commit into
Conversation
de1d180 to
200f3e4
Compare
|
CC @jayzhan211 @dwsmith1983 This PR is ready for review now. |
|
Thanks @Phoenix500526, looks good to me. |
|
A couple of small things I missed earlier, none blocking:
Also, the Rust CI jobs (clippy, cargo test) show as skipped here. I ran clippy and the |
Avoid evaluating build keys again just to check for nulls. CLOSES apache#26806
200f3e4 to
62a78ee
Compare
Thanks @dwsmith1983 I've removed the argument. |
Which issue does this PR close?
Closes #26806.
Rationale for this change
After #26793, computed integer build keys can be evaluated twice over the concatenated build batch under
NullEqualsNull: once for the join and again just to check for nulls when selecting anArrayMap.What changes are included in this PR?
Pass the already evaluated key arrays (
&left_values) toarray_map_key_range. Keep the single-key and supported-integer-type checks inside the function, using the evaluated arrays. Derive the build row count fromkey.len()inside the function instead of passing a separatenum_rowsargument. Remove the duplicate expression evaluation, row-count loop, and unused parameters.What is the testing strategy for this PR?
The existing 619 hash join execution tests pass. These cover NULL handling, non-integer and multiple keys, empty inputs, and map selection; no new tests are added because join behavior is unchanged. Formatting,
cargo clippy --all-targets --all-features -- -D warnings, and the full workspace test suite with extended tests also pass.A local example using a computed physical join key was also checked under LLDB: after entering
build_in_memory,BinaryExpr::evaluateis now called once instead of twice. The example's NULL and non-NULL cases retain their results and map selection.The existing
hash_join_semi_anti/right_semi_d100_h100/1000000benchmark was compared with a local main baseline; Criterion reported the change within its noise threshold. This is a regression check, not a measurement of the computed-key improvement.Are there any user-facing changes?
No SQL result or public API changes. Avoids redundant build-key evaluation for eligible null-safe hash joins.