forked from daphne-eu/daphne
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add numRowRes Argument to InnerJoin and SemiJoin
- Introduced `numRowRes` as a parameter for `InnerJoin` and `SemiJoin` kernel functions, indicating the size of the result. - In `InnerJoin`: - If `numRowRes` is -1, the result size is set to `numRowRhs * numRowLhs`. - Otherwise, the result size is determined by `numRowRes`. - In `SemiJoin`: - If `numRowRes` is -1, the result size defaults to `numRowLhs`. - Otherwise, the result size is determined by `numRowRes`. - Updated DaphneDSL: - Added `numRowRes` as an optional parameter for `innerJoin` and `semiJoin` built-in functions. - If not provided, `numRowRes` defaults to -1, which is passed to DaphneIR operations. - Modified DaphneIR: - Made `numRowRes` a mandatory argument for `InnerJoinOp` and `SemiJoinOp`. - Implementation Updates: - Updated `DaphneDSLBuiltins.cpp` to handle default `numRowRes` values. - Set `numRowRes` to -1 in `SQLVisitor.cpp` for compatibility. - Adjusted `kernels.json` to reflect the new parameter in `innerJoin` and `semiJoin`. - Added script-level test cases to validate the new functionality. - Addresses issue `daphne-eu#901` by allowing users to specify result size to prevent over-allocation.
- Loading branch information
1 parent
576bde3
commit e814a8d
Showing
13 changed files
with
95 additions
and
18 deletions.
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
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,14 @@ | ||
# test inner join with optional arg for result size | ||
f1 = createFrame( | ||
[1, 2], [3, 4], | ||
"a", "b" | ||
); | ||
f2 = createFrame( | ||
[3, 4, 5], [6, 7, 8], | ||
"c", "d" | ||
); | ||
|
||
f3 = innerJoin(f1, f2, "b", "c"); | ||
f4 = innerJoin(f1, f2, "b", "c", 2); | ||
print(f3); | ||
print(f4); |
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,6 @@ | ||
Frame(2x4, [a:int64_t, b:int64_t, c:int64_t, d:int64_t]) | ||
1 3 3 6 | ||
2 4 4 7 | ||
Frame(2x4, [a:int64_t, b:int64_t, c:int64_t, d:int64_t]) | ||
1 3 3 6 | ||
2 4 4 7 |
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,8 @@ | ||
#test inner join with optional arg for result size | ||
f1 = createFrame([ 1, 2 ], [ 3, 4 ], "a", "b"); | ||
f2 = createFrame([ 3, 4, 5 ], [ 6, 7, 8 ], "c", "d"); | ||
|
||
keys1, tids1 = semiJoin(f1, f2, "b", "c"); | ||
keys2, tids2 = semiJoin(f1, f2, "b", "c", 2); | ||
print(f1[tids1, ]); | ||
print(f1[tids2, ]); |
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,6 @@ | ||
Frame(2x2, [a:int64_t, b:int64_t]) | ||
1 3 | ||
2 4 | ||
Frame(2x2, [a:int64_t, b:int64_t]) | ||
1 3 | ||
2 4 |
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