-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-42631][CONNECT] Support custom extensions in Scala client
### What changes were proposed in this pull request? This PR adds public interfaces for creating `Dataset` and `Column` instances, and for executing commands. These interfaces only allow creating `Plan`s and `Expression`s that contain an `extension` to limit what we need to expose. ### Why are the changes needed? Required to implement extensions to the Scala Spark Connect client. ### Does this PR introduce _any_ user-facing change? Yes, adds new public interfaces (see above). ### How was this patch tested? Added unit tests. Closes #40234 from tomvanbussel/SPARK-34827. Authored-by: Tom van Bussel <tom.vanbussel@databricks.com> Signed-off-by: Herman van Hovell <herman@databricks.com> (cherry picked from commit a9c5efa) Signed-off-by: Herman van Hovell <herman@databricks.com>
- Loading branch information
1 parent
e194260
commit a1d5e89
Showing
14 changed files
with
130 additions
and
6 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
2 changes: 2 additions & 0 deletions
2
...onnect/common/src/test/resources/query-tests/explain-results/expression_extension.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,2 @@ | ||
Project [id#0L AS abc#0L] | ||
+- LocalRelation <empty>, [id#0L, a#0, b#0] |
1 change: 1 addition & 0 deletions
1
.../connect/common/src/test/resources/query-tests/explain-results/relation_extension.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 @@ | ||
LocalRelation <empty>, [id#0L, a#0, b#0] |
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
26 changes: 26 additions & 0 deletions
26
connector/connect/common/src/test/resources/query-tests/queries/expression_extension.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,26 @@ | ||
{ | ||
"common": { | ||
"planId": "1" | ||
}, | ||
"project": { | ||
"input": { | ||
"common": { | ||
"planId": "0" | ||
}, | ||
"localRelation": { | ||
"schema": "struct\u003cid:bigint,a:int,b:double\u003e" | ||
} | ||
}, | ||
"expressions": [{ | ||
"extension": { | ||
"@type": "type.googleapis.com/spark.connect.ExamplePluginExpression", | ||
"child": { | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "id" | ||
} | ||
}, | ||
"customField": "abc" | ||
} | ||
}] | ||
} | ||
} |
Binary file added
BIN
+127 Bytes
...ctor/connect/common/src/test/resources/query-tests/queries/expression_extension.proto.bin
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
connector/connect/common/src/test/resources/query-tests/queries/relation_extension.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,16 @@ | ||
{ | ||
"common": { | ||
"planId": "1" | ||
}, | ||
"extension": { | ||
"@type": "type.googleapis.com/spark.connect.ExamplePluginRelation", | ||
"input": { | ||
"common": { | ||
"planId": "0" | ||
}, | ||
"localRelation": { | ||
"schema": "struct\u003cid:bigint,a:int,b:double\u003e" | ||
} | ||
} | ||
} | ||
} |
Binary file added
BIN
+108 Bytes
connector/connect/common/src/test/resources/query-tests/queries/relation_extension.proto.bin
Binary file not shown.
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