Skip to content

Conversation

@tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #2173

Rationale for this change

Follows on from #2310 and applies the same treatment to HashJoinExec

What changes are included in this PR?

Extract the common futures shenanigans into a OnceAsync and then uses this within both CrossJoinExec and HashJoinExec

Are there any user-facing changes?

HashJoinExec no longer evaluates during the plan

num_rows,
start.elapsed().as_millis()
);
let on_right = self.on.iter().map(|on| on.1.clone()).collect::<Vec<_>>();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend comparing with whitespace ignored - https://github.com/apache/arrow-datafusion/pull/2317/files?w=1

let right_stream = self.right.execute(partition, context.clone()).await?;
let on_right = self.on.iter().map(|on| on.1.clone()).collect::<Vec<_>>();

let num_rows = left_data.1.num_rows();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is moved into the stream implementation

match build_side.as_ref() {
Some(stream) => stream.clone(),
None => {
let start = Instant::now();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is moved into collect_left_input

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

cc @Dandandan

p.s. Note I am pretty sure @tustvold is away this week

RecordBatchStream, SendableRecordBatchStream,
};
use crate::execution::context::TaskContext;
use crate::physical_plan::join_utils::{OnceAsync, OnceFut};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@alamb alamb merged commit 4fe59b9 into apache:master Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HashJoinExec Evaluates in ExecutionPlan::execute

3 participants