thswlsqls opened a new pull request, #16870:
URL: https://github.com/apache/iceberg/pull/16870

   ## Summary
   
   - Override `newInputFile(String, long)` in `OSSFileIO`. Without it, the 
`FileIO` default (`api/.../io/FileIO.java:46`) drops the length, so OSS issues 
a HEAD request (`getSimplifiedObjectMeta`) on `getLength()` even when the 
caller already knows the size.
   - The override passes the length to the existing `OSSInputFile` length 
constructor, removing that HEAD round trip.
   - Matches the sibling FileIO implementations that already override this 
method: `S3FileIO.java:156`, `GCSFileIO.java:111`, `ADLSFileIO.java:100`.
   
   ## Testing done
   
   - Added `TestOSSFileIO#testNewInputFileWithLength`: `newInputFile(location, 
length).getLength()` returns the known length with zero 
`getSimplifiedObjectMeta` calls, and `newInputFile(location).getLength()` still 
issues one HEAD call.
   - `./gradlew :iceberg-aliyun:check` — passed (TestOSSFileIO 6, 
TestOSSInputFile 4, 0 failures; includes spotlessCheck + checkstyle + 
errorProne).
   - No integrationTest: aliyun has no `integrationTest` source set; OSS tests 
run against the in-memory mock under `:check`, so no real OSS backend or Docker 
is needed.


-- 
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]

Reply via email to