Gabriel39 commented on code in PR #70869: URL: https://github.com/apache/doris/pull/70869#discussion_r4674882301
########## fe/fe-iceberg-common/src/main/java/org/apache/doris/connector/iceberg/IcebergV4FileIO.java: ########## @@ -0,0 +1,416 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.connector.iceberg; + +import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.LoadingCache; +import org.apache.iceberg.ContentFile; +import org.apache.iceberg.DataFile; +import org.apache.iceberg.DeleteFile; +import org.apache.iceberg.FileFormat; +import org.apache.iceberg.InternalData; +import org.apache.iceberg.ManifestFile; +import org.apache.iceberg.ManifestListFile; +import org.apache.iceberg.Schema; +import org.apache.iceberg.Snapshot; +import org.apache.iceberg.StructLike; +import org.apache.iceberg.TableMetadata; +import org.apache.iceberg.TableMetadataParser; +import org.apache.iceberg.avro.AvroIterable; +import org.apache.iceberg.exceptions.NotFoundException; +import org.apache.iceberg.io.CloseableIterable; +import org.apache.iceberg.io.FileIO; +import org.apache.iceberg.io.InputFile; +import org.apache.iceberg.io.OutputFile; +import org.apache.iceberg.types.Types; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** Serializable, borrowed read view for table-relative format v4 locations. */ +public final class IcebergV4FileIO implements FileIO { + private static final long serialVersionUID = 1L; + private static final Pattern SCHEME = Pattern.compile("^[a-zA-Z][a-zA-Z0-9+.-]*:.*", Pattern.DOTALL); + private final FileIO delegate; + private final String tableLocation; + private final String metadataFileLocation; + private final Map<Long, String> inlineSnapshotLists; + private transient volatile TableMetadata metadata; + private transient LoadingCache<String, TableMetadata> metadataFiles; + private transient LoadingCache<String, Integer> manifestVersions; + private transient LoadingCache<Long, MetadataHeader> snapshotHeaders; + private transient ConcurrentMap<String, MetadataLocation> metadataLocations; + + public IcebergV4FileIO(FileIO delegate, String tableLocation) { + this(delegate, tableLocation, null); + } + + public IcebergV4FileIO(FileIO delegate, String tableLocation, TableMetadata metadata) { + this(delegate, tableLocation, metadata, metadata == null ? null : metadata.metadataFileLocation(), + metadata != null && metadata.metadataFileLocation() == null ? metadata.snapshots().stream() + .filter(snapshot -> snapshot.manifestListLocation() != null) + .collect(Collectors.toMap(Snapshot::snapshotId, Snapshot::manifestListLocation)) : Map.of()); + } + + private IcebergV4FileIO(FileIO delegate, String tableLocation, + TableMetadata metadata, String metadataFileLocation, Map<Long, String> inlineSnapshotLists) { + this.delegate = Objects.requireNonNull(delegate, "delegate"); + this.tableLocation = tableLocation; + this.metadata = metadata; + this.metadataFileLocation = metadataFileLocation; + // REST responses may supply inline metadata without a metadata-file identity to reopen on the BE. + this.inlineSnapshotLists = Map.copyOf(inlineSnapshotLists); + } + + public FileIO delegate() { + return delegate; + } + + public IcebergV4FileIO withDelegate(FileIO replacement) { + return new IcebergV4FileIO(replacement, tableLocation, metadata, metadataFileLocation, inlineSnapshotLists); + } + + private TableMetadata metadata() { + if (metadata == null && metadataFileLocation != null) { + metadata = metadataFiles().get(metadataFileLocation); + } + return metadata; + } + + private synchronized LoadingCache<String, TableMetadata> metadataFiles() { + if (metadataFiles == null) { + // Transport only the immutable metadata-file identity, not all snapshot history in every JNI task. + // The cache coalesces lazy remote loads without doing I/O under this initialization lock. + metadataFiles = Caffeine.newBuilder().maximumSize(1) + .build(path -> TableMetadataParser.read(delegate, path)); + } + return metadataFiles; + } + + public static String resolve(String tableLocation, String path) { + Objects.requireNonNull(path, "path"); + if (isAbsolute(path)) { + return path; + } + if (tableLocation == null || tableLocation.isEmpty()) { + throw new IllegalArgumentException("Relative Iceberg v4 path requires a table location: " + path); + } + // Duplicate separators are part of an object-store key, including at the concatenation boundary. + return tableLocation + "/" + path; + } + + private static boolean isAbsolute(String path) { + return SCHEME.matcher(path).matches(); + } + + public String resolveLocation(String path) { + return resolve(tableLocation, path); + } + + public String resolveContentFile(ContentFile<?> file) { + return isAbsolute(file.location()) || isLegacyEntry(file) + ? file.location() : resolve(tableLocation, file.location()); + } + + private boolean isLegacyEntry(ContentFile<?> file) { + String manifest = file.manifestLocation(); + // Encoding alone is insufficient: the SDK can also write a V4 manifest using Avro. + return manifest != null && FileFormat.fromFileName(manifest) == FileFormat.AVRO + && versions().get(manifest) < 4; + } + + private synchronized LoadingCache<String, Integer> versions() { + if (manifestVersions == null) { + // Keep only small version numbers; never serialize a query's cache into every metadata task. + manifestVersions = Caffeine.newBuilder().maximumSize(256).build(this::readManifestVersion); + } + return manifestVersions; + } + + private int readManifestVersion(String manifest) { + MetadataLocation reference = manifest.startsWith("/") ? locations().get(manifest) : null; + if (manifest.startsWith("/") && reference == null) { + throw new IllegalStateException("Manifest reference has not been bound: " + manifest); + } + String location = reference == null ? resolve(tableLocation, manifest) : reference.location; + return readHeader(delegate.newInputFile(location), FileFormat.AVRO).version; + } + + /** Bind provenance even on a parsed-manifest cache hit, where the SDK will not open the manifest again. */ + public void prepareManifest(ManifestFile file) { + if (file.path().startsWith("/")) { + metadataLocation(file); + } + } + + /** A cached-only prefetch probe runs under its queue lock and must never bind provenance through I/O. */ + public boolean isManifestPrepared(ManifestFile file) { + if (!file.path().startsWith("/")) { + return true; + } + MetadataLocation bound = locations().get(file.path()); + return bound != null && Objects.equals(bound.snapshotId, file.snapshotId()); + } + + private synchronized ConcurrentMap<String, MetadataLocation> locations() { + if (metadataLocations == null) { + // Query-owned provenance, not a cross-query cache. Retain only ambiguous slash-leading references. + metadataLocations = new ConcurrentHashMap<>(); + } + return metadataLocations; + } + + private String remember(String path, String location, Long snapshotId) { + MetadataLocation previous = locations().putIfAbsent(path, new MetadataLocation(location, snapshotId)); + if (previous != null && !previous.location.equals(location)) { + throw new IllegalArgumentException("Ambiguous legacy and V4 metadata reference: " + path); + } + return location; + } + + private synchronized LoadingCache<Long, MetadataHeader> snapshots() { + if (snapshotHeaders == null) { + snapshotHeaders = Caffeine.newBuilder().maximumSize(256).build(id -> { + TableMetadata current = metadata(); + Snapshot snapshot = current == null ? null : current.snapshot(id); + String path = snapshot == null ? inlineSnapshotLists.get(id) : snapshot.manifestListLocation(); + return path == null ? null : snapshotHeader(path, id); + }); + } + return snapshotHeaders; + } + + private MetadataHeader snapshotHeader(String path, long snapshotId) { + String relative = resolve(tableLocation, path); + MetadataHeader header = existingHeader(relative, FileFormat.AVRO); + if (header != null && Objects.equals(header.snapshotId, snapshotId)) { + if (path.startsWith("/")) { + remember(path, relative, snapshotId); + } + return header; + } + if (path.startsWith("/")) { + header = existingHeader(path, FileFormat.AVRO); + if (header != null && Objects.equals(header.snapshotId, snapshotId)) { + remember(path, path, snapshotId); + return header; + } + } + throw new NotFoundException("Cannot find manifest list for snapshot %s: %s", snapshotId, path); + } + + private String metadataLocation(ManifestFile file) { + String path = file.path(); + MetadataLocation bound = locations().get(path); + if (bound != null && Objects.equals(bound.snapshotId, file.snapshotId())) { + return bound.location; + } + MetadataHeader source = file.snapshotId() == null ? null : snapshots().get(file.snapshotId()); + // Only a pre-V4 producer proves that a slash-leading reference is filesystem-rooted. + // New V4 references remain relative, including when an unrelated root path also exists. + if (source != null && source.version < 4) { + return remember(path, path, file.snapshotId()); + } + String relative = resolve(tableLocation, path); + if (existingInput(relative) != null) { + return remember(path, relative, file.snapshotId()); + } + if (source != null && source.version >= 4 && !source.location.startsWith("/")) { + throw new NotFoundException("Cannot find relative V4 manifest: %s", relative); + } + // SDK 1.12 retains unqualified write.metadata.path locations after subsequent V4 commits. + // Rewrites may contain only EXISTING entries, so their snapshot ID cannot be proved from ADDED rows. + // A physically rooted list in the same directory establishes the SDK's filesystem metadata convention. + InputFile root = existingInput(path); + if (root != null && (hasRootedMetadataDirectory(path) Review Comment: Fixed in 5072e047bf25. A reachable rooted manifest is no longer required to share the current list directory or contain an ADDED entry. Resolution validates its concrete file against the immutable descriptor length, retaining the V4 relative-file check and the known-producer refusal path. The new six-way test covers original versions 2/3/4, all-EXISTING rewrites, expired producing snapshots, a moved metadata directory, and both present/absent table locations. It checks exact paths through serialized IO and repeated cached/uncached native planning. The original layout failed before this correction; all six cases now pass. ########## fe/fe-iceberg-common/src/main/java/org/apache/doris/connector/iceberg/IcebergV4FileIO.java: ########## @@ -0,0 +1,416 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.connector.iceberg; + +import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.LoadingCache; +import org.apache.iceberg.ContentFile; +import org.apache.iceberg.DataFile; +import org.apache.iceberg.DeleteFile; +import org.apache.iceberg.FileFormat; +import org.apache.iceberg.InternalData; +import org.apache.iceberg.ManifestFile; +import org.apache.iceberg.ManifestListFile; +import org.apache.iceberg.Schema; +import org.apache.iceberg.Snapshot; +import org.apache.iceberg.StructLike; +import org.apache.iceberg.TableMetadata; +import org.apache.iceberg.TableMetadataParser; +import org.apache.iceberg.avro.AvroIterable; +import org.apache.iceberg.exceptions.NotFoundException; +import org.apache.iceberg.io.CloseableIterable; +import org.apache.iceberg.io.FileIO; +import org.apache.iceberg.io.InputFile; +import org.apache.iceberg.io.OutputFile; +import org.apache.iceberg.types.Types; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** Serializable, borrowed read view for table-relative format v4 locations. */ +public final class IcebergV4FileIO implements FileIO { + private static final long serialVersionUID = 1L; + private static final Pattern SCHEME = Pattern.compile("^[a-zA-Z][a-zA-Z0-9+.-]*:.*", Pattern.DOTALL); + private final FileIO delegate; + private final String tableLocation; + private final String metadataFileLocation; + private final Map<Long, String> inlineSnapshotLists; + private transient volatile TableMetadata metadata; + private transient LoadingCache<String, TableMetadata> metadataFiles; + private transient LoadingCache<String, Integer> manifestVersions; + private transient LoadingCache<Long, MetadataHeader> snapshotHeaders; + private transient ConcurrentMap<String, MetadataLocation> metadataLocations; + + public IcebergV4FileIO(FileIO delegate, String tableLocation) { + this(delegate, tableLocation, null); + } + + public IcebergV4FileIO(FileIO delegate, String tableLocation, TableMetadata metadata) { + this(delegate, tableLocation, metadata, metadata == null ? null : metadata.metadataFileLocation(), + metadata != null && metadata.metadataFileLocation() == null ? metadata.snapshots().stream() + .filter(snapshot -> snapshot.manifestListLocation() != null) + .collect(Collectors.toMap(Snapshot::snapshotId, Snapshot::manifestListLocation)) : Map.of()); + } + + private IcebergV4FileIO(FileIO delegate, String tableLocation, + TableMetadata metadata, String metadataFileLocation, Map<Long, String> inlineSnapshotLists) { + this.delegate = Objects.requireNonNull(delegate, "delegate"); + this.tableLocation = tableLocation; + this.metadata = metadata; + this.metadataFileLocation = metadataFileLocation; + // REST responses may supply inline metadata without a metadata-file identity to reopen on the BE. + this.inlineSnapshotLists = Map.copyOf(inlineSnapshotLists); + } + + public FileIO delegate() { + return delegate; + } + + public IcebergV4FileIO withDelegate(FileIO replacement) { + return new IcebergV4FileIO(replacement, tableLocation, metadata, metadataFileLocation, inlineSnapshotLists); + } + + private TableMetadata metadata() { + if (metadata == null && metadataFileLocation != null) { + metadata = metadataFiles().get(metadataFileLocation); Review Comment: Fixed in 5072e047bf25 by removing BE metadata JSON reconstruction. Before serialization, FE prepares each lazy metadata task with only its own resolved manifest/list reference; it does not ship a raw metadata pointer or the full history. Relative metadata pointers with and without a leading slash now pass serialization and subsequent reads. Nine metadata-table task round trips also cover the SDK's static JSON/list sizing paths. The JNI regression deletes the JSON before task serialization and still reads the bound Parquet manifest, proving that the transported read no longer depends on reopening it. ########## fe/fe-iceberg-common/src/main/java/org/apache/doris/connector/iceberg/IcebergV4FileIO.java: ########## @@ -0,0 +1,416 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.connector.iceberg; + +import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.LoadingCache; +import org.apache.iceberg.ContentFile; +import org.apache.iceberg.DataFile; +import org.apache.iceberg.DeleteFile; +import org.apache.iceberg.FileFormat; +import org.apache.iceberg.InternalData; +import org.apache.iceberg.ManifestFile; +import org.apache.iceberg.ManifestListFile; +import org.apache.iceberg.Schema; +import org.apache.iceberg.Snapshot; +import org.apache.iceberg.StructLike; +import org.apache.iceberg.TableMetadata; +import org.apache.iceberg.TableMetadataParser; +import org.apache.iceberg.avro.AvroIterable; +import org.apache.iceberg.exceptions.NotFoundException; +import org.apache.iceberg.io.CloseableIterable; +import org.apache.iceberg.io.FileIO; +import org.apache.iceberg.io.InputFile; +import org.apache.iceberg.io.OutputFile; +import org.apache.iceberg.types.Types; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** Serializable, borrowed read view for table-relative format v4 locations. */ +public final class IcebergV4FileIO implements FileIO { + private static final long serialVersionUID = 1L; + private static final Pattern SCHEME = Pattern.compile("^[a-zA-Z][a-zA-Z0-9+.-]*:.*", Pattern.DOTALL); + private final FileIO delegate; + private final String tableLocation; + private final String metadataFileLocation; + private final Map<Long, String> inlineSnapshotLists; + private transient volatile TableMetadata metadata; + private transient LoadingCache<String, TableMetadata> metadataFiles; + private transient LoadingCache<String, Integer> manifestVersions; + private transient LoadingCache<Long, MetadataHeader> snapshotHeaders; + private transient ConcurrentMap<String, MetadataLocation> metadataLocations; + + public IcebergV4FileIO(FileIO delegate, String tableLocation) { + this(delegate, tableLocation, null); + } + + public IcebergV4FileIO(FileIO delegate, String tableLocation, TableMetadata metadata) { + this(delegate, tableLocation, metadata, metadata == null ? null : metadata.metadataFileLocation(), + metadata != null && metadata.metadataFileLocation() == null ? metadata.snapshots().stream() + .filter(snapshot -> snapshot.manifestListLocation() != null) + .collect(Collectors.toMap(Snapshot::snapshotId, Snapshot::manifestListLocation)) : Map.of()); + } + + private IcebergV4FileIO(FileIO delegate, String tableLocation, + TableMetadata metadata, String metadataFileLocation, Map<Long, String> inlineSnapshotLists) { + this.delegate = Objects.requireNonNull(delegate, "delegate"); + this.tableLocation = tableLocation; + this.metadata = metadata; + this.metadataFileLocation = metadataFileLocation; + // REST responses may supply inline metadata without a metadata-file identity to reopen on the BE. + this.inlineSnapshotLists = Map.copyOf(inlineSnapshotLists); + } + + public FileIO delegate() { + return delegate; + } + + public IcebergV4FileIO withDelegate(FileIO replacement) { + return new IcebergV4FileIO(replacement, tableLocation, metadata, metadataFileLocation, inlineSnapshotLists); + } + + private TableMetadata metadata() { + if (metadata == null && metadataFileLocation != null) { + metadata = metadataFiles().get(metadataFileLocation); + } + return metadata; + } + + private synchronized LoadingCache<String, TableMetadata> metadataFiles() { + if (metadataFiles == null) { + // Transport only the immutable metadata-file identity, not all snapshot history in every JNI task. + // The cache coalesces lazy remote loads without doing I/O under this initialization lock. + metadataFiles = Caffeine.newBuilder().maximumSize(1) + .build(path -> TableMetadataParser.read(delegate, path)); + } + return metadataFiles; + } + + public static String resolve(String tableLocation, String path) { + Objects.requireNonNull(path, "path"); + if (isAbsolute(path)) { + return path; + } + if (tableLocation == null || tableLocation.isEmpty()) { + throw new IllegalArgumentException("Relative Iceberg v4 path requires a table location: " + path); + } + // Duplicate separators are part of an object-store key, including at the concatenation boundary. + return tableLocation + "/" + path; + } + + private static boolean isAbsolute(String path) { + return SCHEME.matcher(path).matches(); + } + + public String resolveLocation(String path) { + return resolve(tableLocation, path); + } + + public String resolveContentFile(ContentFile<?> file) { + return isAbsolute(file.location()) || isLegacyEntry(file) + ? file.location() : resolve(tableLocation, file.location()); + } + + private boolean isLegacyEntry(ContentFile<?> file) { + String manifest = file.manifestLocation(); + // Encoding alone is insufficient: the SDK can also write a V4 manifest using Avro. + return manifest != null && FileFormat.fromFileName(manifest) == FileFormat.AVRO + && versions().get(manifest) < 4; + } + + private synchronized LoadingCache<String, Integer> versions() { + if (manifestVersions == null) { + // Keep only small version numbers; never serialize a query's cache into every metadata task. + manifestVersions = Caffeine.newBuilder().maximumSize(256).build(this::readManifestVersion); + } + return manifestVersions; + } + + private int readManifestVersion(String manifest) { + MetadataLocation reference = manifest.startsWith("/") ? locations().get(manifest) : null; + if (manifest.startsWith("/") && reference == null) { + throw new IllegalStateException("Manifest reference has not been bound: " + manifest); + } + String location = reference == null ? resolve(tableLocation, manifest) : reference.location; + return readHeader(delegate.newInputFile(location), FileFormat.AVRO).version; + } + + /** Bind provenance even on a parsed-manifest cache hit, where the SDK will not open the manifest again. */ + public void prepareManifest(ManifestFile file) { + if (file.path().startsWith("/")) { + metadataLocation(file); + } + } + + /** A cached-only prefetch probe runs under its queue lock and must never bind provenance through I/O. */ + public boolean isManifestPrepared(ManifestFile file) { + if (!file.path().startsWith("/")) { + return true; + } + MetadataLocation bound = locations().get(file.path()); + return bound != null && Objects.equals(bound.snapshotId, file.snapshotId()); + } + + private synchronized ConcurrentMap<String, MetadataLocation> locations() { + if (metadataLocations == null) { + // Query-owned provenance, not a cross-query cache. Retain only ambiguous slash-leading references. + metadataLocations = new ConcurrentHashMap<>(); + } + return metadataLocations; + } + + private String remember(String path, String location, Long snapshotId) { + MetadataLocation previous = locations().putIfAbsent(path, new MetadataLocation(location, snapshotId)); + if (previous != null && !previous.location.equals(location)) { + throw new IllegalArgumentException("Ambiguous legacy and V4 metadata reference: " + path); + } + return location; + } + + private synchronized LoadingCache<Long, MetadataHeader> snapshots() { + if (snapshotHeaders == null) { + snapshotHeaders = Caffeine.newBuilder().maximumSize(256).build(id -> { + TableMetadata current = metadata(); + Snapshot snapshot = current == null ? null : current.snapshot(id); + String path = snapshot == null ? inlineSnapshotLists.get(id) : snapshot.manifestListLocation(); + return path == null ? null : snapshotHeader(path, id); + }); + } + return snapshotHeaders; + } + + private MetadataHeader snapshotHeader(String path, long snapshotId) { + String relative = resolve(tableLocation, path); + MetadataHeader header = existingHeader(relative, FileFormat.AVRO); + if (header != null && Objects.equals(header.snapshotId, snapshotId)) { + if (path.startsWith("/")) { + remember(path, relative, snapshotId); + } + return header; + } + if (path.startsWith("/")) { + header = existingHeader(path, FileFormat.AVRO); + if (header != null && Objects.equals(header.snapshotId, snapshotId)) { + remember(path, path, snapshotId); + return header; + } + } + throw new NotFoundException("Cannot find manifest list for snapshot %s: %s", snapshotId, path); + } + + private String metadataLocation(ManifestFile file) { + String path = file.path(); + MetadataLocation bound = locations().get(path); + if (bound != null && Objects.equals(bound.snapshotId, file.snapshotId())) { + return bound.location; + } + MetadataHeader source = file.snapshotId() == null ? null : snapshots().get(file.snapshotId()); + // Only a pre-V4 producer proves that a slash-leading reference is filesystem-rooted. + // New V4 references remain relative, including when an unrelated root path also exists. + if (source != null && source.version < 4) { + return remember(path, path, file.snapshotId()); + } + String relative = resolve(tableLocation, path); Review Comment: Fixed in 5072e047bf25. Resolution only constructs a relative candidate when a table base exists, then validates the retained rooted file directly. It therefore does not call resolve(null, rootedPath) before the valid root can be considered. The missing-base variants for original versions 2/3/4 expire the source snapshot and move the output directory, and verify serialized IO plus cached/uncached native ranges. Older rooted data entries retain their original paths; genuinely relative V4 entries still require a base. -- 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]
