-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
core/src/main/java/io/substrait/relation/physical/HashJoin.java
Outdated
Show resolved
Hide resolved
@@ -174,6 +175,21 @@ void join() { | |||
verifyRoundTrip(rel); | |||
} | |||
|
|||
@Test | |||
void hashJoin() { | |||
int[] left_keys = {}; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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());
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 👍
core/src/main/java/io/substrait/relation/physical/HashJoin.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
@vbarua Thank you for the review. I will address the comments. |
core/src/main/java/io/substrait/relation/RelProtoConverter.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/substrait/relation/ProtoRelConverter.java
Outdated
Show resolved
Hide resolved
@vbarua ready for another round of review and left a few questions too 🙂 |
core/src/main/java/io/substrait/relation/ProtoRelConverter.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/substrait/type/proto/JoinRoundtripTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/substrait/type/proto/JoinRoundtripTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 🙂
@vbarua I will make these changes and thank you for the quick response 🙏 |
9832689
to
aeaa0f2
Compare
@vbarua addressed the reviews 🙂 |
There was a problem hiding this 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 🙇
Appreciate your support 🙏 |
* fix: pojo to proto JoinRel conversion skipped postJoinFilter
This PR includes the base work for integrating HashEquiJoin.