-
Notifications
You must be signed in to change notification settings - Fork 63
Adds INNER JOIN, LEFT JOIN, Path Step Key & Fixes ExprStruct #1294
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
Conversation
Conformance comparison report
Number passing in both: 5384 Number failing in both: 434 Number passing in Base (7a65f05) but now fail: 0 Number failing in Base (7a65f05) but now pass: 0 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## partiql-eval #1294 +/- ##
===============================================
Coverage ? 49.28%
Complexity ? 1046
===============================================
Files ? 166
Lines ? 13392
Branches ? 2500
===============================================
Hits ? 6600
Misses ? 6135
Partials ? 657
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
import org.partiql.value.PartiQLValue | ||
import org.partiql.value.PartiQLValueExperimental | ||
|
||
internal abstract class RelJoin : Operator.Relation { |
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.
internal abstract class RelJoin : Operator.Relation { | |
/** | |
* https://people.inf.elte.hu/miiqaai/elektroModulatorDva.pdf#page=756 | |
*/ | |
internal abstract class RelJoinNestedLoop : Operator.Relation { |
I would keep pointers though rather than storing relations and iterators. This should be O(m*n) time but only O(1) space because it streams. I think you've made it O(m+n) space
lhsIterator.forEach { lhsRecord -> | ||
rhsIterator.forEach { rhsRecord -> | ||
val input = lhsRecord + rhsRecord | ||
val result = condition.eval(input) | ||
getOutputRecord(result.isTrue(), lhsRecord, rhsRecord)?.let { return it } | ||
} | ||
} |
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.
This is simple enough for now, but we don't have to store both relations for this. You keep a pointer to the left-hand-side record and right-hand-side record. Advance the right-hand-side until condition holds, then yield. Once right-hand-side is exhausted, increment the left hand side.
We have to really test our PartiQLValue equality and hash now and we can use different join algorithms
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.
Agreed. I'm going to merge this now with the intention of modifying this in the next PR. There's only one way to go and that's up.
Relevant Issues
Description
Other Information
Updated Unreleased Section in CHANGELOG: NO
Any backward-incompatible changes? NO
Any new external dependencies? NO
Do your changes comply with the Contributing Guidelines
and Code Style Guidelines? YES
License Information
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.