You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid re-evaluating build keys in array_map_key_range #26806
Is your feature request related to a problem or challenge?
array_map_key_range (datafusion/physical-plan/src/joins/hash_join/exec.rs) takes the build batches and, under NullEqualsNull, evaluates the join key expressions again to check for nulls. It also sums num_rows over the batches.
After #26793, build_in_memory concatenates first and has already evaluated the keys into left_values before it calls array_map_key_range, which now always gets that one concatenated batch. For a computed key that is an array map candidate under NullEqualsNull, the keys are evaluated twice, and the second copy covers the whole build side rather than one input batch at a time.
Describe the solution you'd like
Pass &left_values[0] (for the null count) and num_rows to array_map_key_range instead of &[RecordBatch]. This drops the duplicate evaluation and the row count loop, and makes the function's inputs match what it actually uses.
Describe alternatives you've considered
Leave it as is. It only matters for computed integer keys under NullEqualsNull, and the extra evaluation is transient.
Activity