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

feat: initial HashJoinRel support #187

Merged
merged 12 commits into from
Oct 25, 2023
Merged

Conversation

vibhatha
Copy link
Contributor

@vibhatha vibhatha commented Oct 4, 2023

This PR includes the base work for integrating HashEquiJoin.

Copy link
Contributor

@danepitkin danepitkin left a comment

Choose a reason for hiding this comment

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

Nice work!

CHANGELOG.md Outdated Show resolved Hide resolved
core/src/main/java/io/substrait/relation/AbstractJoin.java Outdated Show resolved Hide resolved
@vibhatha vibhatha marked this pull request as ready for review October 11, 2023 02:09
@@ -174,6 +175,21 @@ void join() {
verifyRoundTrip(rel);
}

@Test
void hashJoin() {
int[] left_keys = {};
Copy link
Member

Choose a reason for hiding this comment

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

Should we have some tests with non-empty keys to make sure that's working correctly?

Copy link
Member

Choose a reason for hiding this comment

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

+1 to using non-empty keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vbarua @EpsilonPrime
Looking into the commonTable initialization, we do have empty lists to create it, so if we use non-empty lists for keys, we may need to introduce a commonTable with non-empty initialization? Am I following this incorrectly?

final Rel commonTable =
      b.namedScan(Collections.emptyList(), Collections.emptyList(), Collections.emptyList());

Copy link
Member

Choose a reason for hiding this comment

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

we may need to introduce a commonTable with non-empty initialization?

This is correct. You can use the b.namedScan method to create a table with columns, something like

b.namedScan(List.of("example"), List.of("a"), List.of(R.STRING)

One small structural thing. The tests in ExtensionRoundtripTest.java verify that extensions roundtrip. The test that you've added already does this perfectly well.

For adding a test using non-empty keys, could I ask that you introduce something like JoinRountripTest.java (in a similar vein to AggregateRoundtripTest.java) and do it there. That will also be a good place to add nested join tests later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vbarua I will defintely add a test class as you have susggested here. 👍

Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

Overall this looks really good. Left some comments.

@vibhatha
Copy link
Contributor Author

@vbarua Thank you for the review. I will address the comments.

@vibhatha
Copy link
Contributor Author

@vbarua ready for another round of review and left a few questions too 🙂

@vibhatha vibhatha requested a review from vbarua October 20, 2023 03:16
Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

Overall change looks good. Left some final comments. I think we can get this in next week 🙂

@vibhatha
Copy link
Contributor Author

@vbarua I will make these changes and thank you for the quick response 🙏

@vibhatha
Copy link
Contributor Author

@vbarua addressed the reviews 🙂

Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

LGMT! Thanks for contribution 🙇

@vbarua vbarua changed the title Adding HashJoin feat: initial HashJoinRel support Oct 25, 2023
@vbarua vbarua merged commit 46d03ca into substrait-io:main Oct 25, 2023
8 checks passed
@vibhatha
Copy link
Contributor Author

Appreciate your support 🙏

This was referenced Nov 3, 2023
ajegou pushed a commit to ajegou/substrait-java that referenced this pull request Mar 29, 2024
* fix: pojo to proto JoinRel conversion skipped postJoinFilter
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.

4 participants