-
Notifications
You must be signed in to change notification settings - Fork 2
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: implement join
operation
#32
Open
dshaaban01
wants to merge
9
commits into
substrait-io:main
Choose a base branch
from
dshaaban01:dalia/join/op
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
095af9b
implement join
dshaaban01 959c396
cLaNg sAgA :skull:
dshaaban01 fa7646e
hi
dshaaban01 0172bcc
minor
dshaaban01 f60e77d
first draft new join - i have commented out my first attempt at prope…
dshaaban01 f77df3d
small error
dshaaban01 396a9d7
fix tests
dshaaban01 afc3b8e
TYPE INFERENCE HALLELUJAH
dshaaban01 ff2b1e6
clang tingz
dshaaban01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
// RUN: substrait-opt -split-input-file %s \ | ||
// RUN: | FileCheck %s | ||
|
||
// CHECK-LABEL: substrait.plan | ||
// CHECK: relation | ||
// CHECK: %[[V0:.*]] = named_table | ||
// CHECK: %[[V1:.*]] = named_table | ||
// CHECK-NEXT: %[[V2:.*]] = join unspecified %[[V0]], %[[V1]] | ||
// CHECK-SAME: : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
// CHECK-NEXT: yield %[[V2]] : tuple<si32, si32> | ||
|
||
substrait.plan version 0 : 42 : 1 { | ||
relation { | ||
%0 = named_table @t1 as ["a"] : tuple<si32> | ||
%1 = named_table @t2 as ["b"] : tuple<si32> | ||
%2 = join unspecified %0, %1 : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
yield %2 : tuple<si32, si32> | ||
} | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: substrait.plan | ||
// CHECK: relation | ||
// CHECK: %[[V0:.*]] = named_table | ||
// CHECK: %[[V1:.*]] = named_table | ||
// CHECK-NEXT: %[[V2:.*]] = join inner %[[V0]], %[[V1]] | ||
// CHECK-SAME: : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
// CHECK-NEXT: yield %[[V2]] : tuple<si32, si32> | ||
|
||
substrait.plan version 0 : 42 : 1 { | ||
relation { | ||
%0 = named_table @t1 as ["a"] : tuple<si32> | ||
%1 = named_table @t2 as ["b"] : tuple<si32> | ||
%2 = join inner %0, %1 : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
yield %2 : tuple<si32, si32> | ||
} | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: substrait.plan | ||
// CHECK: relation | ||
// CHECK: %[[V0:.*]] = named_table | ||
// CHECK: %[[V1:.*]] = named_table | ||
// CHECK-NEXT: %[[V2:.*]] = join outer %[[V0]], %[[V1]] | ||
// CHECK-SAME: : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
// CHECK-NEXT: yield %[[V2]] : tuple<si32, si32> | ||
|
||
substrait.plan version 0 : 42 : 1 { | ||
relation { | ||
%0 = named_table @t1 as ["a"] : tuple<si32> | ||
%1 = named_table @t2 as ["b"] : tuple<si32> | ||
%2 = join outer %0, %1 : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
yield %2 : tuple<si32, si32> | ||
} | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: substrait.plan | ||
// CHECK: relation | ||
// CHECK: %[[V0:.*]] = named_table | ||
// CHECK: %[[V1:.*]] = named_table | ||
// CHECK-NEXT: %[[V2:.*]] = join left %[[V0]], %[[V1]] | ||
// CHECK-SAME: : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
// CHECK-NEXT: yield %[[V2]] : tuple<si32, si32> | ||
|
||
substrait.plan version 0 : 42 : 1 { | ||
relation { | ||
%0 = named_table @t1 as ["a"] : tuple<si32> | ||
%1 = named_table @t2 as ["b"] : tuple<si32> | ||
%2 = join left %0, %1 : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
yield %2 : tuple<si32, si32> | ||
} | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: substrait.plan | ||
// CHECK: relation | ||
// CHECK: %[[V0:.*]] = named_table | ||
// CHECK: %[[V1:.*]] = named_table | ||
// CHECK-NEXT: %[[V2:.*]] = join right %[[V0]], %[[V1]] | ||
// CHECK-SAME: : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
// CHECK-NEXT: yield %[[V2]] : tuple<si32, si32> | ||
|
||
substrait.plan version 0 : 42 : 1 { | ||
relation { | ||
%0 = named_table @t1 as ["a"] : tuple<si32> | ||
%1 = named_table @t2 as ["b"] : tuple<si32> | ||
%2 = join right %0, %1 : tuple<si32>, tuple<si32> -> tuple<si32, si32> | ||
yield %2 : tuple<si32, si32> | ||
} | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: substrait.plan | ||
// CHECK: relation | ||
// CHECK: %[[V0:.*]] = named_table | ||
// CHECK: %[[V1:.*]] = named_table | ||
// CHECK-NEXT: %[[V2:.*]] = join semi %[[V0]], %[[V1]] | ||
// CHECK-SAME: : tuple<si1>, tuple<si32> -> tuple<si1> | ||
// CHECK-NEXT: yield %[[V2]] : tuple<si1> | ||
|
||
substrait.plan version 0 : 42 : 1 { | ||
relation { | ||
%0 = named_table @t1 as ["a"] : tuple<si1> | ||
%1 = named_table @t2 as ["b"] : tuple<si32> | ||
%2 = join semi %0, %1 : tuple<si1>, tuple<si32> -> tuple<si1> | ||
yield %2 : tuple<si1> | ||
} | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: substrait.plan | ||
// CHECK: relation | ||
// CHECK: %[[V0:.*]] = named_table | ||
// CHECK: %[[V1:.*]] = named_table | ||
// CHECK-NEXT: %[[V2:.*]] = join anti %[[V0]], %[[V1]] | ||
// CHECK-SAME: : tuple<si1>, tuple<si32> -> tuple<si1> | ||
// CHECK-NEXT: yield %[[V2]] : tuple<si1> | ||
|
||
substrait.plan version 0 : 42 : 1 { | ||
relation { | ||
%0 = named_table @t1 as ["a"] : tuple<si1> | ||
%1 = named_table @t2 as ["b"] : tuple<si32> | ||
%2 = join anti %0, %1 : tuple<si1>, tuple<si32> -> tuple<si1> | ||
yield %2 : tuple<si1> | ||
} | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: substrait.plan | ||
// CHECK: relation | ||
// CHECK: %[[V0:.*]] = named_table | ||
// CHECK: %[[V1:.*]] = named_table | ||
// CHECK-NEXT: %[[V2:.*]] = join single %[[V0]], %[[V1]] | ||
// CHECK-SAME: : tuple<si32>, tuple<si1> -> tuple<si1> | ||
// CHECK-NEXT: yield %[[V2]] : tuple<si1> | ||
|
||
substrait.plan version 0 : 42 : 1 { | ||
relation { | ||
%0 = named_table @t1 as ["a"] : tuple<si32> | ||
%1 = named_table @t2 as ["b"] : tuple<si1> | ||
%2 = join single %0, %1 : tuple<si32>, tuple<si1> -> tuple<si1> | ||
yield %2 : tuple<si1> | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
Nit: move to enums file?
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 actually don't have an enums file. the SetOpKind Enum is also defined in this file. Should I do a PR that creates a SubstraitEnums.td file?
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.
Oh, OK! My long-pending PR for
aggregate
creates one. Let's move the other enums once that is merged?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.
Lets do that 👍