Dandandan commented on code in PR #5322:
URL: https://github.com/apache/arrow-datafusion/pull/5322#discussion_r1111957319
##########
datafusion/core/src/physical_plan/joins/hash_join.rs:
##########
@@ -742,71 +751,79 @@ fn build_join_indices(
// "| 13 | 10 | 130 | 12 | 10 | 120 |",
// "| 9 | 8 | 90 | 8 | 8 | 80 |",
// "+----+----+-----+----+----+-----+"
-// And the result of left and right indices
-// left indices: 5, 6, 6, 4
-// right indices: 3, 4, 5, 3
-fn build_equal_condition_join_indices(
- left_data: &JoinLeftData,
- right: &RecordBatch,
- left_on: &[Column],
- right_on: &[Column],
+// And the result of build and probe indices are:
+// Build indices: 5, 6, 6, 4
+// Probe indices: 3, 4, 5, 3
+#[allow(clippy::too_many_arguments)]
+pub fn build_equal_condition_join_indices(
+ build_hashmap: &JoinHashMap,
+ build_input_buffer: &RecordBatch,
+ probe_batch: &RecordBatch,
+ build_on: &[Column],
+ probe_on: &[Column],
random_state: &RandomState,
null_equals_null: &bool,
+ hashes_buffer: &mut Vec<u64>,
+ offset: Option<usize>,
) -> Result<(UInt64Array, UInt32Array)> {
- let keys_values = right_on
+ let keys_values = probe_on
.iter()
- .map(|c| Ok(c.evaluate(right)?.into_array(right.num_rows())))
+ .map(|c|
Ok(c.evaluate(probe_batch)?.into_array(probe_batch.num_rows())))
.collect::<Result<Vec<_>>>()?;
- let left_join_values = left_on
+ let build_join_values = build_on
.iter()
- .map(|c|
Ok(c.evaluate(&left_data.1)?.into_array(left_data.1.num_rows())))
+ .map(|c| {
+ Ok(c.evaluate(build_input_buffer)?
+ .into_array(build_input_buffer.num_rows()))
+ })
.collect::<Result<Vec<_>>>()?;
- let hashes_buffer = &mut vec![0; keys_values[0].len()];
Review Comment:
good to reuse it 👍
--
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]