Delta: Use POSIX separator instead of File.separator
- Dominant language
- Java
- Stars
- 9.2k
- Forks
- 3.5k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 132
Description
**Apache Iceberg version**
main @ 035fc1e40
**Query engine**
N/A — engine-agnostic (Delta Lake migration action)
**Please describe the bug**
`BaseSnapshotDeltaLakeTableAction.getFullFilePath()` (`delta-lake/src/main/java/org/apache/iceberg/delta/BaseSnapshotDeltaLakeTableAction.java` line 457) joins a relative data file path with `File.separator`, determined by the host OS running the JVM, not the target filesystem. On Windows, this produces a broken path such as `s3://bucket/table\part-00000.parquet` for any Delta table whose `AddFile`/`RemoveFile` entries use relative paths, regardless of whether the target is local, S3, GCS, or HDFS.
`core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java` (line 63-65) already fixed this exact problem via `public static final String FILE_SEPARATOR = "/"`. `BaseSnapshotDeltaLakeTableAction` never received the same fix.
**Steps to reproduce**
Run `SnapshotDeltaLakeTable` on Windows against a Delta table whose data files use relative paths (the common case). Expected: `tableRoot + "/" + relativePath`. Actual: `tableRoot + "\" + relativePath`.
**Additional context**
`getFullFilePath` is the only path-construction call site for `AddFile`/`RemoveFile` (called from `buildDataFileFromAction`, line 360).
Contributor guide
Research direction
Start in delta-lake/src/main/java/org/apache/iceberg/delta/BaseSnapshotDeltaLakeTableAction.java at getFullFilePath(), then compare its joining logic with core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java lines 63-65. Verify the change with relative AddFile and RemoveFile paths on Windows and confirm generated paths use POSIX separators for local and remote filesystems.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100