yuhao-su opened a new issue, #3312:
URL: https://github.com/apache/iceberg-rust/issues/3312

   ### Apache Iceberg Rust version
   
   main (deab0692f)
   
   ### Describe the bug
   
   For ADLS paths, `AzureStoragePath` keeps the URL path as is, so the relative 
path handed to OpenDAL starts with `/` (`/dir/file.parquet`). The other 
backends strip `<scheme>://<bucket>/` and pass `dir/file.parquet`.
   
   OpenDAL's `Operator` methods normalize the path, so reads and writes work. 
`FileIO::delete_stream` uses OpenDAL's `Deleter`, which passes the path to the 
service unchanged (apache/opendal#8351):
   
   - Release builds send `DELETE <endpoint>/<filesystem>//dir/file.parquet`, 
and ADLS Gen2 returns 400 `InvalidUri`. We hit this on a real ADLS Gen2 account 
with a downstream fork that has the same `azdls.rs`.
   - Debug builds panic in OpenDAL's `build_abs_path` with `path must not start 
with /`.
   
   `drop_table_data`, and with it `purge_table` in the memory, SQL, Glue, and 
HMS catalogs, therefore cannot delete table files on ADLS.
   
   ### To Reproduce
   
   On main, this test in the `tests` module of 
`crates/storage/opendal/src/lib.rs`, run with `--features opendal-azdls`, 
panics before any request is sent:
   
   ```rust
   #[cfg(feature = "opendal-azdls")]
   #[tokio::test]
   async fn tmp_repro_azdls_delete_stream() {
       let storage = OpenDalStorage::Azdls {
           config: Arc::new(AzdlsConfig {
               account_name: Some("myaccount".to_string()),
               account_key: Some("a2V5".to_string()),
               endpoint: 
Some("http://127.0.0.1:9/core.windows.net".to_string()),
               ..Default::default()
           }),
       };
       let paths = futures::stream::iter(vec![
           
"abfs://[email protected]/dir/file.parquet".to_string(),
       ])
       .boxed();
       let res = storage.delete_stream(paths).await;
       println!("delete_stream result: {res:?}");
   }
   ```
   
   ```text
   thread 'tests::tmp_repro_azdls_delete_stream' panicked at 
.../opendal-core-0.58.1/src/raw/path.rs:36:9:
   path must not start with /
   ```
   
   ### Expected behavior
   
   `delete_stream` deletes `dir/file.parquet` in filesystem `myfs`, the same 
object that reads and `FileIO::delete` resolve to. The relative path should not 
start with `/`, as with the other backends.
   
   ### Willingness to contribute
   
   I can contribute a fix for this bug independently. A fix is in #3311.
   
   Written with AI assistance (Claude Code).
   


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