Skip to content

ADLS: Throw NotFoundException for inexistent input file#15806

Open
findinpath wants to merge 1 commit intoapache:mainfrom
findinpath:findinpath/adls-not-found
Open

ADLS: Throw NotFoundException for inexistent input file#15806
findinpath wants to merge 1 commit intoapache:mainfrom
findinpath:findinpath/adls-not-found

Conversation

@findinpath
Copy link
Copy Markdown
Contributor

@findinpath findinpath commented Mar 28, 2026

Signal to the TableOperations that there is no retry needed for files which do not exist.

Relates to #15734

Fixes #15760

Additional context

Relevant apache/iceberg code using this change

Tasks.foreach(newLocation)
.retry(numRetries)
.exponentialBackoff(100, 5000, 600000, 4.0 /* 100, 400, 1600, ... */)
.throwFailureWhenFinished()
.stopRetryOn(NotFoundException.class) // overridden if shouldRetry is non-null
.shouldRetryTest(shouldRetry)
.run(metadataLocation -> newMetadata.set(metadataLoader.apply(metadataLocation)));

Signal to the TableOperations that there is no retry needed
for files which do not exist.
@github-actions github-actions bot added the AZURE label Mar 28, 2026
try {
return fileClient.openInputStream(getInputOptions(range));
} catch (RuntimeException e) {
throwNotFoundIfPresent(e, location);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A file may be removed may happen also WHILE being read and we could have as well situations in which NotFoundException should be thrown.

I didn't add this handling though in the read(..) methods yet because I consider the scenario rather exotic (and the next retry would catch anyway the fact that the file is not found).

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.

Throw NotFoundException for inexistent input Azure file

1 participant