Azure: Translate not-found errors in ADLSInputStream mid-stream reads#17064
Open
thswlsqls wants to merge 1 commit into
Open
Azure: Translate not-found errors in ADLSInputStream mid-stream reads#17064thswlsqls wants to merge 1 commit into
thswlsqls wants to merge 1 commit into
Conversation
ADLSInputStream.read()/read(byte[],int,int) propagated the raw IOException from the underlying Azure SDK stream when the file was deleted after the stream was opened, instead of translating it to NotFoundException like openRange() already does. GCSInputStream handles this via GCSExceptionUtil.throwNotFoundIfNotPresent. Generated-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17062
Summary
ADLSInputStream.read()/read(byte[], int, int)propagated the rawIOExceptionfromstream.read(...)when the file was deleted after the stream opened, instead of translating it toNotFoundException.openRange()in the same class already does this translation; this change makesread()/read(byte[], int, int)consistent with it, and withGCSInputStream'sGCSExceptionUtil.throwNotFoundIfNotPresentpattern.openRange/readFully/readTailbut missed the mid-streamreadmethods.ADLSInputStreamis package-private, so no API compatibility impact.Testing done
TestADLSInputStream#readTranslatesNotFoundOnMidStreamReadand#readBufferTranslatesNotFoundOnMidStreamRead, coveringread()andread(byte[], int, int)throwingNotFoundExceptionwhen the mocked stream raises anIOExceptionwrapping aBlobStorageExceptionwithx-ms-error-code: BlobNotFound../gradlew :iceberg-azure:test --tests "org.apache.iceberg.azure.adlsv2.TestADLSInputStream"— 6 tests passed../gradlew :iceberg-azure:spotlessCheck :iceberg-azure:checkstyleMain :iceberg-azure:checkstyleTest— passed. (:iceberg-azure:checkalso runsintegrationTest, which requires Docker/Azurite and was not available in this environment, so unit test/style/checkstyle were verified separately as shown above.)