thswlsqls opened a new issue, #17062:
URL: https://github.com/apache/iceberg/issues/17062

   **Apache Iceberg version**
   main @ 035fc1e40
   
   **Query engine**
   N/A — engine-agnostic (org.apache.iceberg.azure.adlsv2.ADLSInputStream)
   
   **Please describe the bug**
   `ADLSInputStream.read()` and `read(byte[], int, int)` 
(azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSInputStream.java, 
lines 113-146) call `stream.read(...)` directly and let the raw `IOException` 
propagate when the underlying file is deleted after the stream was opened (for 
example by a concurrent orphan-file cleanup or snapshot expiration). 
`openRange()` (same file, lines 199-208) already translates this into 
`NotFoundException` via `throwNotFoundIfNotPresent`, and 
`GCSInputStream.read()`/`read(byte[], int, int)` 
(gcp/src/main/java/org/apache/iceberg/gcp/gcs/GCSInputStream.java, lines 66-98) 
already does the same for GCS. This is a leftover gap from issue #13528 
("Inconsistent handling of non-existent object locations across FileIO 
implementations", fixed by PR #15806/#15734), which addressed 
`openRange`/`readFully`/`readTail` but not the mid-stream `read` methods.
   
   The Azure SDK's `BlobInputStream.dispatchRead` wraps `BlobStorageException` 
inside `IOException` (`catch (BlobStorageException e) { throw new 
IOException(e); }`), so the fix must `catch (IOException e)` and pass 
`e.getCause()` to `throwNotFoundIfNotPresent`, matching the GCS pattern.
   
   **Steps to reproduce**
   1. Open an `ADLSInputStream` for an existing ADLS Gen2 file.
   2. Delete the underlying file/blob (e.g. concurrent cleanup) after the 
stream is opened.
   3. Call `read()` or `read(byte[], int, int)`.
   Expected: `NotFoundException`. Actual: raw `IOException` wrapping 
`BlobStorageException`/`DataLakeStorageException`.
   
   **Additional context**
   N/A — code path fully described above.
   


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