-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This commit introduces a new `groupSum()` built-in function to DaphneDSL, enabling the creation of a `GroupOp` in DaphneIR and closes #903. Changes Implemented 1. `groupSum()` Built-in Function in DaphneDSL: - Interface: `group(arg:frame, groupCols:str, ..., sumCol:str)` - Accepts: - A frame as input. - At least one column to group on. - A single column to compute the sum. - Aggregation Support: - Only supports `SUM` as the aggregation function. 3. **Test Cases**: - Added script-level tests to validate the functionality of the `group()` function in DaphneDSL.
- Loading branch information
1 parent
7136e0d
commit 44ff77b
Showing
5 changed files
with
61 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Grouping and sum aggregation (two grouping columns). | ||
|
||
fr = createFrame([ 11, 11, 22, 33, 33 ], [ 1, 1, 2, 3, 4 ], | ||
[ 100, 200, 300, 400, 500 ], "a", "b", "c"); | ||
|
||
res = groupSum(fr, "a", "b", "c"); | ||
|
||
print(res); |
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,5 @@ | ||
Frame(4x3, [a:int64_t, b:int64_t, SUM(c):int64_t]) | ||
11 1 300 | ||
22 2 300 | ||
33 3 400 | ||
33 4 500 |