starhel opened a new issue, #18872:
URL: https://github.com/apache/iceberg/issues/18872

   ### Apache Iceberg version
   
   1.12.0 (latest release)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   ## Problem
   
   Creating a table with a `file:///...` JDBC catalog warehouse produces mixed 
URI spellings: the metadata JSON's `location` uses `file:///...`, while 
metadata file paths use `file:/...`.
   
   Both forms are valid local file URIs ([RFC 
8089](https://www.rfc-editor.org/rfc/rfc8089.html#appendix-B)), but 
`rewrite_table_path` compares prefixes textually. A `file:/...` source prefix 
matches file paths but not `location`; a `file:///...` prefix has the opposite 
problem.
   
   ## Reproduction
   
   Run the attached script with `uv` and Java installed:
   
   ```bash
   uv run --script repro_file_uri.py
   ```
   
   It downloads dependencies, creates a temporary SQLite JDBC catalog with a 
local `file:///...` warehouse, creates a table, inserts one row, and calls 
`rewrite_table_path`. No metadata is manually modified.
   
   The script exits with:
   
   ```text
   IllegalArgumentException: Path 
file:///tmp/iceberg-file-uri-.../warehouse/db/t/
   does not start with file:/tmp/iceberg-file-uri-.../warehouse/
   ```
   
   ## Expected behavior
   
   `rewrite_table_path` should handle equivalent local file URI spellings 
consistently and relocate a normally created table without manual metadata 
changes.
   
   
[repro_file_uri.py](https://github.com/user-attachments/files/34630826/repro_file_uri.py)
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [x] I cannot contribute a fix for this bug at this time


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