You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2026/09/02 22:23:47 UTC
[PR] fix: Bump iceberg-rust so native Iceberg writes URL-escape partition paths [datafusion-comet]
andygrove opened a new pull request, #5651:
URL: https://github.com/apache/datafusion-comet/pull/5651
## Which issue does this PR close?
Closes #5636. Closes #5641.
## Rationale for this change
The native Iceberg writer pins iceberg-rust at `3d84c81` (2026-07-29), one day before apache/iceberg-rust#2875 merged. That fix makes `PartitionSpec::partition_to_path` form-urlencode partition field names and values, which is what iceberg-java's `PartitionSpec.partitionToPath` has always done through `URLEncoder.encode`. Without it the native writer commits raw partition directories: a value containing `#` or `?` lands in the manifest as a location that iceberg-java's `S3FileIO` parses as a URI fragment or query, so a table written by Comet resolves to a different object key when read back through the standard Java path. This is the first phase-1 item of the native Iceberg writes epic (#5649).
## What changes are included in this PR?
- `native/Cargo.toml` pins `iceberg` and `iceberg-storage-opendal` to `8adaa872f31549dd5ad8255848715758228038bc`, the merge commit of apache/iceberg-rust#2875. That revision has the same arrow (58.4), parquet (58.4), DataFusion (54.1), and opendal (0.57) versions as the current pin, so the lockfile change is confined to the two iceberg crates and no Comet code needed to change. The v0.10.1 release was considered and rejected: it sits on a release branch that does not contain the fix and pins DataFusion 53.
- `iceberg-writes.md` drops the "partition paths are not URL-escaped" operational caveat and the eligibility table's cross-reference to it; the layouts now match.
Both encoders use the application/x-www-form-urlencoded table: alphanumerics and `*-._` unescaped, space as `+`, everything else percent-encoded as UTF-8, and `null` for a null value. The commits between this revision and iceberg-rust `main` (opendal 0.58, `ObjectStorageLocationGenerator`, a GCS host fix, additional parquet writer settings) are left for the pin policy in #5645 so this change stays a targeted correctness fix.
## How are these changes tested?
A new test in `CometIcebergWriteActionSuite`, "partition paths are URL-escaped like iceberg-java", writes the same rows through the native writer and the JVM writer into two tables partitioned by a string column whose values contain `/`, `#`, `?`, space, `=`, `%`, `+`, the unescaped set `*-._`, multi-byte characters, and the empty string. It asserts that the set of partition directories under each table's data location is identical, that the expected encodings (`region=a%2Fb`, `region=c%23d`, `region=g+h`, `region=*-._`) are present, and that the natively written table reads back correctly through both Comet's native scan and iceberg-java's reader.
The existing Iceberg suites (native scan, write action, write detection, rewrite actions, fuzz, reflection, proto translation) were run locally against the new pin on the default Spark profile.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: Bump iceberg-rust so native Iceberg writes URL-escape partition paths [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on PR #5651:
URL: https://github.com/apache/datafusion-comet/pull/5651#issuecomment-5527330713
cc @anuragmantri
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: Bump iceberg-rust so native Iceberg writes URL-escape partition paths [datafusion-comet]
Posted by "unikdahal (via GitHub)" <gi...@apache.org>.
unikdahal commented on code in PR #5651:
URL: https://github.com/apache/datafusion-comet/pull/5651#discussion_r3919497917
##########
spark/src/test/scala/org/apache/comet/CometIcebergWriteActionSuite.scala:
##########
@@ -1172,6 +1172,59 @@ class CometIcebergWriteActionSuite
}
}
+ // iceberg-java's `PartitionSpec.partitionToPath` runs every partition name and value through
+ // `URLEncoder.encode`, and iceberg-rust's `partition_to_path` uses the same
+ // application/x-www-form-urlencoded table (apache/iceberg-rust#2875). Readers resolve files
+ // through manifest metadata rather than paths, but the committed location still has to be one
+ // every FileIO can open: an unescaped `#` in an S3 key is a fragment delimiter to `S3FileIO`.
+ test("native acceleration: partition paths are URL-escaped like iceberg-java") {
+ assumeNativeAcceleration()
+ withIcebergCatalog { warehouseDir =>
+ createTable(warehouseDir, "escaped_native", partitionSpec = "PARTITIONED BY (region)")
+ createTable(warehouseDir, "escaped_jvm", partitionSpec = "PARTITIONED BY (region)")
+ val regions = Seq("a/b", "c#d", "e?f", "g h", "i=j", "k%l", "m+n", "*-._", "日本", "")
+ val values = regions.zipWithIndex
+ .map { case (region, i) => s"($i, '$region', $i.5)" }
+ .mkString(", ")
+
+ spark.sql(s"INSERT INTO $catalog.$ns.escaped_native VALUES $values")
Review Comment:
Is this actually exercising the native writer? `COMET_ICEBERG_NATIVE_WRITE_ENABLED` is off by default, and the existing native-write tests use `assertNativeWriteEngages` / `withNativeEnabled`.
Without that, this could become JVM-vs-JVM and still pass with the old iceberg-rust revision. Could we use `assertNativeWriteEngages` here?
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: Bump iceberg-rust so native Iceberg writes URL-escape partition paths [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove merged PR #5651:
URL: https://github.com/apache/datafusion-comet/pull/5651
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: Bump iceberg-rust so native Iceberg writes URL-escape partition paths [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on PR #5651:
URL: https://github.com/apache/datafusion-comet/pull/5651#issuecomment-5531800029
> Reviewed `f13e1118` against `10537e14`. The upstream encoder is a simple fit without adding a Comet-specific path rewriter. I found no additional material defect in the dependency/path change.
>
> [P2] The [existing native-writer coverage concern](https://github.com/apache/datafusion-comet/pull/5651#discussion_r3919497917) remains. The new INSERT does not enable native writing, so the directory comparison can pass with JVM writers on both sides. Please use `assertNativeWriteEngages`. Its helper also enables the local-table-scan conversion needed by the VALUES input and asserts `CometIcebergWriteExec`. Showing the repaired test fail with the old pin and pass with the new pin would establish the regression coverage.
>
> A focused component check using the locked Rust encoder matched Java `URLEncoder` in all 160 cases. The old raw-formatting adapter differed in 89. The lock audit found only the two Iceberg records changed, with no package-version changes. These are component/source checks, not a Spark/native-writer or storage round trip. Current CI has 55 successful, 10 running and 7 skipped checks. Successful shard metadata alone does not prove this test exercised native writing.
This is now fixed
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: Bump iceberg-rust so native Iceberg writes URL-escape partition paths [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on PR #5651:
URL: https://github.com/apache/datafusion-comet/pull/5651#issuecomment-5533292984
Merged. Thanks @sunchao @unikdahal @anuragmantri
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: Bump iceberg-rust so native Iceberg writes URL-escape partition paths [datafusion-comet]
Posted by "unikdahal (via GitHub)" <gi...@apache.org>.
unikdahal commented on PR #5651:
URL: https://github.com/apache/datafusion-comet/pull/5651#issuecomment-5532646553
Thank @andygrove the test concern is addressed in the latest commit. LGTM now.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: Bump iceberg-rust so native Iceberg writes URL-escape partition paths [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #5651:
URL: https://github.com/apache/datafusion-comet/pull/5651#discussion_r3928474181
##########
spark/src/test/scala/org/apache/comet/CometIcebergWriteActionSuite.scala:
##########
@@ -1172,6 +1172,59 @@ class CometIcebergWriteActionSuite
}
}
+ // iceberg-java's `PartitionSpec.partitionToPath` runs every partition name and value through
+ // `URLEncoder.encode`, and iceberg-rust's `partition_to_path` uses the same
+ // application/x-www-form-urlencoded table (apache/iceberg-rust#2875). Readers resolve files
+ // through manifest metadata rather than paths, but the committed location still has to be one
+ // every FileIO can open: an unescaped `#` in an S3 key is a fragment delimiter to `S3FileIO`.
+ test("native acceleration: partition paths are URL-escaped like iceberg-java") {
+ assumeNativeAcceleration()
+ withIcebergCatalog { warehouseDir =>
+ createTable(warehouseDir, "escaped_native", partitionSpec = "PARTITIONED BY (region)")
+ createTable(warehouseDir, "escaped_jvm", partitionSpec = "PARTITIONED BY (region)")
+ val regions = Seq("a/b", "c#d", "e?f", "g h", "i=j", "k%l", "m+n", "*-._", "日本", "")
+ val values = regions.zipWithIndex
+ .map { case (region, i) => s"($i, '$region', $i.5)" }
+ .mkString(", ")
+
+ spark.sql(s"INSERT INTO $catalog.$ns.escaped_native VALUES $values")
Review Comment:
You were right, and the test was not exercising the native writer. `spark.comet.iceberg.write.enabled` is off by default, so both inserts went through the JVM writer and the comparison was JVM vs JVM.
Fixed in e0bd7bfe9: the native insert is now wrapped in `assertNativeWriteEngages("escaped_native", regions.indices)`, which flips the conf, enables the local-table-scan conversion the inline `VALUES` input needs, and asserts a `CometIcebergWriteExec` in the captured plan. The JVM twin now runs on the suite defaults instead of toggling `splitOperator.enabled`, matching the other parity tests.
To confirm the repaired test is genuine regression coverage, I rebuilt the native library against both pins.
Old pin (`3d84c81`), fails:
```
- native acceleration: partition paths are URL-escaped like iceberg-java *** FAILED ***
HashSet("region=e?f", "region=g h", "region=i=j", "region=", "region=*-._", "region=k%l",
"region=a/b", "region=c#d", "region=日本", "region=m+n")
did not equal
HashSet("region=a%2Fb", "region=e%3Ff", "region=", "region=%E6%97%A5%E6%9C%AC", "region=*-._",
"region=k%25l", "region=g+h", "region=i%3Dj", "region=c%23d", "region=m%2Bn")
(CometIcebergWriteActionSuite.scala:1210)
Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0
```
New pin (`8adaa87`), passes:
```
- native acceleration: partition paths are URL-escaped like iceberg-java (8 seconds, 956 milliseconds)
Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
```
The old-pin output is the failure mode this PR is about: `region=a/b` splits into a nested directory, and `region=c#d` lands raw, which is the key `S3FileIO` would resolve differently. The full `CometIcebergWriteActionSuite` on the new pin is 53 succeeded, 0 failed.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org