Commit dc6d0e8
committed
[SPARK-52361] Support
### What changes were proposed in this pull request?
This PR aims to support `executeCommand` API of `SparkSession`.
In addition, `DataSourceNotFound` is added to `SparkConnectError`.
### Why are the changes needed?
For feature parity.
### Does this PR introduce _any_ user-facing change?
No behavior change.
### How was this patch tested?
Pass the CIs.
Since `Apache Spark` distribution has no built-in `ExternalCommandRunner`. I crafted the following for manual testing. In this PR, the added test case only checks the API invocation part.
```bash
$ cat MyCommand.java
public class MyCommand implements org.apache.spark.sql.connector.ExternalCommandRunner {
Override
public String[] executeCommand(String command, org.apache.spark.sql.util.CaseInsensitiveStringMap options) {
String[] result = {"Hello", command};
return result;
}
}
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes apache#187 from dongjoon-hyun/SPARK-52361.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>executeCommand in SparkSession
1 parent 30bd8c4 commit dc6d0e8
File tree
4 files changed
+40
-0
lines changed- Sources/SparkConnect
- Tests/SparkConnectTests
4 files changed
+40
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| |||
715 | 717 | | |
716 | 718 | | |
717 | 719 | | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
718 | 738 | | |
719 | 739 | | |
720 | 740 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
270 | 277 | | |
271 | 278 | | |
272 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
144 | 156 | | |
145 | 157 | | |
146 | 158 | | |
| |||
0 commit comments