You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2026/08/27 22:12:01 UTC
(iceberg) branch main updated: Core: Preserve trailing slash on table location in V4 manifest reader (#17807)
This is an automated email from the ASF dual-hosted git repository.
rdblue pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new 375aa33d99 Core: Preserve trailing slash on table location in V4 manifest reader (#17807)
375aa33d99 is described below
commit 375aa33d997292e90ed438caf01cbf1254776eb9
Author: Anoop Johnson <an...@apache.org>
AuthorDate: Thu Aug 27 15:11:53 2026 -0700
Core: Preserve trailing slash on table location in V4 manifest reader (#17807)
The V4 manifest reader stripped a trailing slash from the table location
before resolving relative file locations against it. Remove the strip
as it should be done by the catalog during table creation. It is not
the reader's responsibility
---
.../src/main/java/org/apache/iceberg/V4ManifestReader.java | 2 +-
.../test/java/org/apache/iceberg/TestV4ManifestReader.java | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/core/src/main/java/org/apache/iceberg/V4ManifestReader.java b/core/src/main/java/org/apache/iceberg/V4ManifestReader.java
index dca4d67fa3..382441bace 100644
--- a/core/src/main/java/org/apache/iceberg/V4ManifestReader.java
+++ b/core/src/main/java/org/apache/iceberg/V4ManifestReader.java
@@ -190,7 +190,7 @@ class V4ManifestReader extends CloseableGroup implements CloseableIterable<Track
Preconditions.checkArgument(tableLocation != null, "Invalid table location: null");
this.file = file;
this.specsById = specsById;
- this.tableLocation = LocationUtil.stripTrailingSlash(tableLocation);
+ this.tableLocation = tableLocation;
this.unionPartitionType = Partitioning.unionPartitionTypes(specsById.values());
Schema base = TrackedFile.schema(unionPartitionType, Types.StructType.of());
// the read schema carries row_position (via BASE_TYPE) so the reader can fill manifestPos
diff --git a/core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java b/core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java
index 3f2cbdd4e1..1eb735b77e 100644
--- a/core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java
+++ b/core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java
@@ -746,6 +746,20 @@ class TestV4ManifestReader {
verifyLocationAfterWriteReadRoundTrip(format, file, resolved(file));
}
+ @ParameterizedTest
+ @FieldSource("MANIFEST_FORMATS")
+ public void usesTableLocationVerbatim(FileFormat format) throws IOException {
+ TrackedFile file = dataFile("data/00000-0.parquet", EMPTY_PARTITION_DATA);
+
+ InputFile manifest = writeManifest(format, EMPTY_PARTITION, ImmutableList.of(file));
+
+ try (V4ManifestReader reader =
+ V4ManifestReader.builder(manifest, UNPARTITIONED_SPECS, "s3://bucket/db/table/").build()) {
+ TrackedFile actual = Iterables.getOnlyElement(reader);
+ assertThat(actual.location()).isEqualTo("s3://bucket/db/table//data/00000-0.parquet");
+ }
+ }
+
@ParameterizedTest
@FieldSource("MANIFEST_FORMATS")
public void resolvesRelativeDeletionVectorLocation(FileFormat format) throws IOException {