dongjoon-hyun opened a new pull request, #590:
URL: https://github.com/apache/spark-connect-swift/pull/590
### What changes were proposed in this pull request?
This PR aims to fix `DataFrameReader.load` and `DataStreamReader.load` to
set `DataSource.format` only when a format is specified.
### Why are the changes needed?
`DataSource.format` is a proto3 `optional` field. Previously, `load` always
assigned `self.source` (initialized to `""`) to it, so the server saw
`hasFormat == true` and called `reader.format("")` instead of falling back to
`spark.sql.sources.default`. As a result, `spark.read.load(path)` and
`spark.readStream.schema(...).load(path)` without `format(...)` failed.
```
[DATA_SOURCE_NOT_FOUND] Failed to find the data source: . Make sure the
provider name is correct and the package is properly registered and compatible
with your Spark version. SQLSTATE: 42K02
```
This is consistent with the PySpark Connect client, which sets
`data_source.format` only when `format` is not `None`.
### Does this PR introduce _any_ user-facing change?
Yes. `load` without `format(...)` now uses the default data source
(`spark.sql.sources.default`) instead of failing.
### How was this patch tested?
Pass the CIs with the newly added test cases
(`DataFrameReaderTests.loadWithoutFormat` and
`DataStreamTests.loadWithoutFormat`). Without this fix, the newly added tests
fail with the `DATA_SOURCE_NOT_FOUND` error against Apache Spark 4.2.0 Connect
server.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]