cloud-fan commented on code in PR #47759:
URL: https://github.com/apache/spark/pull/47759#discussion_r1717350991


##########
sql/core/src/test/resources/sql-tests/results/show-create-table.sql.out:
##########
@@ -78,7 +78,7 @@ CREATE TABLE spark_catalog.default.tbl (
   b STRING,
   c INT)
 USING parquet
-LOCATION 'file:///path/to/table'
+LOCATION 'file:/path/to/table'

Review Comment:
   I've investigated this locally. The new result is actually consistent with 
the production behavior (with Hive Metastore). What happens is:
   - CREATE TABLE command qualifies the table location, and keeps it as `URI` 
in `CatalogTable#storage#locationUri`
   - When saving the table into HMS, we have to turn `URI` into string, by 
using `new Path(uri).toString`. The Hadoop Path string will omit the 
`authority` component if it's not present. So `file:///path` becomes 
`file:/path`.
   - When reading the table back from HMS, we turn string back to `URI`, but 
the `authority` component won't be filled.
   
   However, with `InMemoryCatalog`, we keep `CatalogTable` directly and there 
is no `URI` <-> string round trip. So the `authority` component is still there.
   
   This actually doesn't matter, as empty `authority` is the same as no 
`authority`, in `URI` string.



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