haoyangeng-db opened a new pull request, #56211:
URL: https://github.com/apache/spark/pull/56211

   ### What changes were proposed in this pull request?
   
   SPARK-52812 (#56064) made Spark Connect `Catalog.createTable` eager by 
re-routing the two-argument `createTable(tableName, path)` overload through 
`createTable(tableName, path, "parquet")`. That hardcodes the parquet provider 
and drops the `spark.sql.sources.default` fallback that the overload previously 
relied on.
   
   This PR restores the original behavior: the two-argument overload again 
leaves the source unset so the server resolves `spark.sql.sources.default`, 
while keeping the eager execution introduced by SPARK-52812. A regression test 
is added to `CatalogSuite`.
   
   ### Why are the changes needed?
   
   The two-argument `createTable(tableName, path)` overload is documented as 
"It will use the default data source configured by spark.sql.sources.default." 
After SPARK-52812 it always used parquet regardless of that configuration, 
contradicting its own contract and the classic Catalog behavior.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, within the unreleased master branch. 
`spark.catalog.createTable(tableName, path)` on Spark Connect once again honors 
`spark.sql.sources.default` instead of always creating a parquet table. The 
eager-execution behavior from SPARK-52812 is preserved.
   
   ### How was this patch tested?
   
   Added a regression test in `CatalogSuite` that sets 
`spark.sql.sources.default` to `json`, writes JSON data, creates the table via 
the two-argument overload, and asserts the resulting table uses the json 
provider and is readable. The test fails on the previous hardcoded-parquet 
behavior.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Co-authored with Claude Code.


-- 
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]

Reply via email to