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

Adds support for FULL/RIGHT OUTER JOIN and improves performance of JOINs #1295

Merged
merged 5 commits into from
Dec 14, 2023

Conversation

johnedquinn
Copy link
Member

@johnedquinn johnedquinn commented Dec 12, 2023

Relevant Issues

Description

  • Adds support for FULL/RIGHT OUTER JOIN and improves performance of JOINs
  • I needed to update the equality of BagValues. Before, BagValues weren't taking into account being unordered, so I grouped and counted the elements for equality. I also needed to update StructValues to allow for hashCode. I essentially delegated the fields of a struct to some private lazily instantiated _fields variable.

Other Information

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

github-actions bot commented Dec 12, 2023

Conformance comparison report

Base (dccab37) 8728496 +/-
% Passing 92.54% 92.54% 0.00%
✅ Passing 5384 5384 0
❌ Failing 434 434 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0

Number passing in both: 5384

Number failing in both: 434

Number passing in Base (dccab37) but now fail: 0

Number failing in Base (dccab37) but now pass: 0

@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (partiql-eval@dccab37). Click here to learn what that means.

Additional details and impacted files
@@               Coverage Diff               @@
##             partiql-eval    #1295   +/-   ##
===============================================
  Coverage                ?   49.28%           
  Complexity              ?     1046           
===============================================
  Files                   ?      166           
  Lines                   ?    13392           
  Branches                ?     2500           
===============================================
  Hits                    ?     6600           
  Misses                  ?     6135           
  Partials                ?      657           
Flag Coverage Δ
CLI 11.87% <0.00%> (?)
EXAMPLES 80.28% <0.00%> (?)
LANG 54.72% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@johnedquinn johnedquinn marked this pull request as ready for review December 12, 2023 19:48
Comment on lines +32 to +38
if (previousLhs != null && previousRhs != null) {
previousRhs!!.padNull()
val newRecord = previousLhs!! + previousRhs!!
previousLhs = null
previousRhs = null
return newRecord
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What about checking the join condition?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch! Updated and I added a test to use TRUE as the condition.

@@ -471,10 +471,13 @@ public abstract class StructValue<T : PartiQLValue> : PartiQLValue, Sequence<Pai

public abstract val fields: Sequence<Pair<String, T>>?
Copy link
Contributor

Choose a reason for hiding this comment

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

I kind of think this should just be a list or array. Array makes more sense honestly because of fixed size rather than an immutable List, but either way not a sequence

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe you're tackling this in your PR for modifying PartiQL Value.

}

@OptIn(PartiQLValueExperimental::class)
abstract fun getOutputRecord(result: Boolean, lhs: Record, rhs: Record): Record?
Copy link
Contributor

Choose a reason for hiding this comment

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

@johnedquinn johnedquinn merged commit 9b73804 into partiql-eval Dec 14, 2023
@johnedquinn johnedquinn deleted the expand-join branch December 14, 2023 22:22
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