Skip to content

Dell: Implement newInputFile(String, long) to avoid redundant HEAD calls#17056

Open
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/dell-newinputfile-length-cache
Open

Dell: Implement newInputFile(String, long) to avoid redundant HEAD calls#17056
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/dell-newinputfile-length-cache

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Closes #17054

Summary

  • EcsFileIO never overrode FileIO#newInputFile(String, long), so the known length passed by callers (DataFile/DeleteFile/ManifestFile) fell back to the api/ default and was discarded.
  • EcsInputFile#getLength() had no cached length, so it issued a fresh getObjectMetadata() HEAD request to ECS on every call.
  • This matches S3FileIO/GCSFileIO/ADLSFileIO/OSSFileIO, which all override newInputFile(String, long) and cache the length (e.g. aliyun/.../OSSFileIO.java, OSSInputFile.java).

Testing done

  • Added TestEcsInputFile#testKnownLengthAvoidsHeadRequest (length is returned from cache without the mock backend ever creating the object) and TestEcsInputFile#testNegativeLengthIsRejected (negative length throws ValidationException).
  • ./gradlew :iceberg-dell:check — 27 tests passed, 0 failures.

FileIO#newInputFile(String, long) already exists as a default method in
api/, but EcsFileIO never overrode it, so the length hint from callers
(DataFile/DeleteFile/ManifestFile) was silently dropped and
EcsInputFile#getLength() issued a fresh getObjectMetadata() HEAD request
every time. S3FileIO/GCSFileIO/ADLSFileIO/OSSFileIO all cache the known
length instead.

Generated-by: Claude Code
@github-actions github-actions Bot added the DELL label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dell: EcsFileIO does not cache known file length, causing redundant HEAD requests

1 participant