Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: Encapsulate LeftJoinData into a struct (rather than anonymous enum) and add comments #8153

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Nov 13, 2023

Which issue does this PR close?

Related to #8130

Rationale for this change

I am going through this code to understand what is happening, and one thing I think would help would be to use names to refer to fields rather than data.0, data.1, and that could be commented

What changes are included in this PR?

  1. Make fields of JoinData non pub
  2. Add doc comments
  3. Make LeftJoinData a struct with named fields and accessors

Are these changes tested?

Existing tests

Are there any user-facing changes?

No, this is entirely internal code refactoring

@alamb alamb changed the title Minor: Encapsulate LeftJoinData into a struct (rather than anonymous enum) Minor: Encapsulate LeftJoinData into a struct (rather than anonymous enum) Nov 13, 2023
@alamb alamb changed the title Minor: Encapsulate LeftJoinData into a struct (rather than anonymous enum) Minor: Encapsulate LeftJoinData into a struct (rather than anonymous enum) and add comments Nov 13, 2023
@alamb alamb marked this pull request as ready for review November 13, 2023 21:04
@alamb
Copy link
Contributor Author

alamb commented Nov 13, 2023

@Dandandan or @metesynnada I wonder if you might have time to review this (I am in the process of working on #8130 and am trying to encode my findings in comments)

@@ -73,7 +73,47 @@ use datafusion_physical_expr::EquivalenceProperties;
use ahash::RandomState;
use futures::{ready, Stream, StreamExt, TryStreamExt};

type JoinLeftData = (JoinHashMap, RecordBatch, MemoryReservation);
/// HashTable and input data for the left (build side) of a join
struct JoinLeftData {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is just to document the fields better by using names rather than .0, .1, etc

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @alamb

@Dandandan Dandandan merged commit fcd17c8 into apache:main Nov 14, 2023
24 of 25 checks passed
@Dandandan
Copy link
Contributor

Thank you @alamb

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.

3 participants