-
Notifications
You must be signed in to change notification settings - Fork 28.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-46085][CONNECT] Dataset.groupingSets in Scala Spark Connect cl…
…ient ### What changes were proposed in this pull request? This PR proposes to add `Dataset.groupingsets` API added from #43813 to Scala Spark Connect cleint. ### Why are the changes needed? For feature parity. ### Does this PR introduce _any_ user-facing change? Yes, it adds a new API to Scala Spark Connect client. ### How was this patch tested? Unittest was added. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #43995 from HyukjinKwon/SPARK-46085. Authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information
1 parent
a694a8a
commit 5211f6b
Showing
6 changed files
with
102 additions
and
1 deletion.
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
4 changes: 4 additions & 0 deletions
4
connector/connect/common/src/test/resources/query-tests/explain-results/groupingSets.explain
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,4 @@ | ||
Aggregate [a#0, spark_grouping_id#0L], [a#0, max(a#0) AS max(a)#0, count(a#0) AS count(a)#0L] | ||
+- Expand [[id#0L, a#0, b#0, a#0, 0], [id#0L, a#0, b#0, null, 1]], [id#0L, a#0, b#0, a#0, spark_grouping_id#0L] | ||
+- Project [id#0L, a#0, b#0, a#0 AS a#0] | ||
+- LocalRelation <empty>, [id#0L, a#0, b#0] |
50 changes: 50 additions & 0 deletions
50
connector/connect/common/src/test/resources/query-tests/queries/groupingSets.json
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,50 @@ | ||
{ | ||
"common": { | ||
"planId": "1" | ||
}, | ||
"aggregate": { | ||
"input": { | ||
"common": { | ||
"planId": "0" | ||
}, | ||
"localRelation": { | ||
"schema": "struct\u003cid:bigint,a:int,b:double\u003e" | ||
} | ||
}, | ||
"groupType": "GROUP_TYPE_GROUPING_SETS", | ||
"groupingExpressions": [{ | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "a" | ||
} | ||
}], | ||
"aggregateExpressions": [{ | ||
"unresolvedFunction": { | ||
"functionName": "max", | ||
"arguments": [{ | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "a", | ||
"planId": "0" | ||
} | ||
}] | ||
} | ||
}, { | ||
"unresolvedFunction": { | ||
"functionName": "count", | ||
"arguments": [{ | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "a", | ||
"planId": "0" | ||
} | ||
}] | ||
} | ||
}], | ||
"groupingSets": [{ | ||
"groupingSet": [{ | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "a" | ||
} | ||
}] | ||
}, { | ||
}] | ||
} | ||
} |
Binary file added
BIN
+106 Bytes
connector/connect/common/src/test/resources/query-tests/queries/groupingSets.proto.bin
Binary file not shown.