Commit 50e00b7
[SPARK-51425][CONNECT] Add client API to set custom
### What changes were proposed in this pull request?
Adds an additional optional parameter to the Scala/Python APIs to allow a user to explicitly set an `operation_id`.
### Why are the changes needed?
The Spark Connect [protocol](https://github.com/apache/spark/blob/44e751f243a5a7be8e64c306e40ddc1502f72710/sql/connect/common/src/main/protobuf/spark/connect/base.proto#L318) allows the client to set an optional operation ID. However, there is no API that lets a user set this explicitly (although the client does set it in the case of Reaatchable Execution).
### Does this PR introduce _any_ user-facing change?
Yes.
Scala usage:
```scala
client.execute(plan, operationId = Some("10a4c38e-7e87-40ee-9d6f-60ff0751e63b))
```
Python usage:
```python
req = client._execute_plan_request_with_metadata(operation_id="10a4c38e-7e87-40ee-9d6f-60ff0751e63b")
# continue using the req as usual
```
### How was this patch tested?
New unit tests
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #50191 from vicennial/customOpId.
Authored-by: vicennial <venkata.gudesa@databricks.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>operation_id
1 parent a5b4d81 commit 50e00b7
File tree
4 files changed
+62
-2
lines changed- python/pyspark/sql
- connect/client
- tests/connect/client
- sql/connect
- client/jvm/src/test/scala/org/apache/spark/sql/connect/client
- common/src/main/scala/org/apache/spark/sql/connect/client
4 files changed
+62
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
1231 | | - | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1232 | 1234 | | |
1233 | 1235 | | |
1234 | 1236 | | |
| |||
1238 | 1240 | | |
1239 | 1241 | | |
1240 | 1242 | | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1241 | 1252 | | |
1242 | 1253 | | |
1243 | 1254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
258 | 269 | | |
259 | 270 | | |
260 | 271 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
638 | 658 | | |
639 | 659 | | |
640 | 660 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
118 | 127 | | |
119 | 128 | | |
120 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
121 | 132 | | |
122 | 133 | | |
123 | 134 | | |
| |||
127 | 138 | | |
128 | 139 | | |
129 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
| |||
0 commit comments