cstavr opened a new pull request, #47976:
URL: https://github.com/apache/spark/pull/47976
### What changes were proposed in this pull request?
Change the implementation of `createTable` to avoid escaping of special
chars in `UnresolvedTableSpec.location`. This field should contain the original
user-provided `path` option and not the URI that is constructed by the
`buildStorageFormatFromOptions()` call.
### Why are the changes needed?
Bug fix. The following code would result in the creation of a table that is
stored in `/tmp/test%table` instead of `/tmp/test table`:
```
spark.catalog.createTable("testTable", source = "parquet", schema = new
StructType().add("id", "int"), description = "", options = Map("path" ->
"/tmp/test table"))
```
Note that this was not consistent with the SQL API, e.g. `create table
testTable(id int) using parquet location '/tmp/test table'`
### Does this PR introduce _any_ user-facing change?
Yes. The previous behaviour would result in table path be escaped. After
this change the path will not be escaped.
### How was this patch tested?
Updated existing test in `CatalogSuite`.
### Was this patch authored or co-authored using generative AI tooling?
No
--
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]