trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.49k stars 3.02k forks source link

Correctly categorize filesystem error in Iceberg connector #24130

Open mayankvadariya opened 1 week ago

mayankvadariya commented 1 week ago

Description

Explanation on chain of calls and how NotFoundException and UncheckedIOException were chosen in the catch clause.

https://github.com/trinodb/trino/blob/20d025ea8fb24b72bc17d93ef73d7131c1ec1dea/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java#L2968

calls

https://github.com/apache/iceberg/blob/0a705b0637db484730eb4eece69ae6c4d52fd9da/core/src/main/java/org/apache/iceberg/BaseSnapshot.java#L164

calls

https://github.com/apache/iceberg/blob/0a705b0637db484730eb4eece69ae6c4d52fd9da/core/src/main/java/org/apache/iceberg/BaseSnapshot.java#L146

calls https://github.com/apache/iceberg/blob/0a705b0637db484730eb4eece69ae6c4d52fd9da/core/src/main/java/org/apache/iceberg/ManifestLists.java#L43 which returns AvroIterable

AvroIterable has https://github.com/apache/iceberg/blob/0a705b0637db484730eb4eece69ae6c4d52fd9da/core/src/main/java/org/apache/iceberg/avro/AvroIterable.java#L102 which calls file.newStream(), file.getLength()

If file is of ForwardingInputFile type then, ForwardingInputFile#getLength and ForwardingInputFile#newStream may throw NotFoundException and/or UncheckedIOException

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required. ( ) Release notes are required. Please propose a release note for me. ( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)