xndai opened a new issue, #1151:
URL: https://github.com/apache/iceberg-cpp/issues/1151

   When the table location ends with `/`, C++ and Java resolve the same 
relative path to different locations.
   
   - **C++** (`LocationUtil::ResolveLocation`, added in #1124): if the table 
location already ends with `/`, no second separator is added. Table location 
`s3://b/t/` with relative path `data/f.parquet` resolves to 
`s3://b/t/data/f.parquet` 
([code](https://github.com/apache/iceberg-cpp/blob/0764a5d8f2b401889e39d70f91fc3263767bed78/src/iceberg/util/location_util.cc#L78-L106)).
 `RelativizeLocation` likewise treats the trailing `/` as the separator.
   - **Java** 
([`LocationUtil.resolveLocation`](https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/util/LocationUtil.java))
 always adds the separator, so the same input resolves to 
`s3://b/t//data/f.parquet`. Its `relativizeLocation` requires the table 
location followed by `/`.
   - **Spec** ([Path 
Resolution](https://iceberg.apache.org/spec/#path-resolution)): the "Duplicate 
separator" example gives `s3://b/t//data/f.parquet`. The spec recommends that 
table locations not end with a separator, but doesn't require it.
   
   On S3, `s3://b/t//data/f.parquet` and `s3://b/t/data/f.parquet` are 
different object keys. So if a table's location ends with `/`, C++ and Java can 
read different objects for the same relative path in its metadata.
   
   Raised by zhjwpku in 
https://github.com/apache/iceberg-cpp/pull/1124#discussion_r4594574149. We 
should come back and review this.
   


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