aglinxinyuan opened a new pull request, #6546:
URL: https://github.com/apache/texera/pull/6546

   ### What changes were proposed in this PR?
   
   Backport of apache/texera#6545 to `release/v1.2`.
   
   The Python UDF worker creates its output-port Iceberg storage through its own
   pyiceberg path (`iceberg_document.py`/`document_factory.py` →
   `IcebergCatalogInstance.get_instance()` → `create_postgres_catalog`), which 
the
   Scala/JVM fix in #6488 does not reach. On Windows with a local-filesystem
   `postgres` warehouse that path crashes:
   
   | Symptom | Cause |
   |---|---|
   | `Unrecognized filesystem type in URI: c` | a bare drive path `C:\...` is 
parsed by pyiceberg with the drive letter as a URI scheme |
   | `WinError 123` | even a `file:///C:/...` URI is rejected by the default 
pyarrow FileIO |
   
   `create_postgres_catalog` now, **only** when the warehouse carries a Windows 
drive
   letter, normalizes it to a `file:///` URI (built with 
`PureWindowsPath.as_posix()`
   — not `.as_uri()`, which would percent-encode a space to `%20` that fsspec 
would
   not decode) and selects `pyiceberg.io.fsspec.FsspecFileIO`, whose 
`LocalFileSystem`
   handles Windows drive paths. POSIX paths, colon-stripped paths (`C/...`), and
   remote object stores (`s3://...`) keep the plain-path / default-FileIO 
convention
   the Scala engine relies on (#4409). `create_rest_catalog` is left untouched
   (remote identifier resolved by the REST server, S3FileIO).
   
   ### Any related issues, documentation, discussions?
   
   Backport of #6545 (issue #6487, follow-up to #6488). Applies to 
`release/v1.2`.
   
   ### How was this PR tested?
   
   Clean cherry-pick: `release/v1.2`'s `iceberg_utils.py` and
   `test_iceberg_utils_catalog.py` are byte-identical to the fix's base on 
`main`,
   and the branch pins the same `pyiceberg==0.11.1`, so behavior matches the
   verified `main` change exactly. Squashed from `daa71367b5` + `900f2eb0f3`.
   
   On this `release/v1.2` branch: the 14 unit tests in
   `test_iceberg_utils_catalog.py` pass (OS-independent — they assert on the
   computed catalog props, so they run anywhere), and `ruff check` + `ruff 
format
   --check` are clean. No `LICENSE-binary` change — this is a pure-Python code 
fix
   with no new dependency.
   
   No `release/*` label is added — this PR *is* the backport.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8 [1M context])
   


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

Reply via email to