VanshajPoonia opened a new pull request, #3814:
URL: https://github.com/apache/iceberg-rust/pull/3814

   ## Which issue does this PR close?
   
   - Closes #3772.
   
   ## What changes are included in this PR?
   
   This adds `s3.delete.batch-size` and `gcs.delete.batch-size` with the names 
Iceberg Java uses. They live in `iceberg::io` next to the other `S3_*` and 
`GCS_*` keys. Each backend reads only its own key.
   
   - Both default to 1000 like the old `DELETE_BATCH_SIZE`. Nothing changes 
when they are unset. Java defaults to 250 for S3 and 50 for GCS. I kept 1000 to 
avoid a behavior change and can switch to Java's defaults if you prefer.
   - `s3.delete.batch-size` takes 1 to 1000 like Java. `gcs.delete.batch-size` 
takes 1 to `i32::MAX` because Java reads it as an int. Other values fail with 
the key in the error.
   - `PrefixedStorage` flushes each prefix at the size of that prefix's storage.
   - A plain `OpenDalStorage` uses the size too. `OpenDalStorageFactory` builds 
one when no credentials are vended, as with static keys for R2. OpenDAL's 
`Deleter` has no flush. So the storage closes a bucket's deleter after that 
many paths and opens a new one.
   - `OpenDalResolvingStorage` still groups up to 1000 paths per scheme before 
it hands them to that scheme's storage. That storage then applies its own size.
   
   OpenDAL 0.59.5 still caps each request at 1000 keys for S3 and 100 for GCS. 
With the default every backend sends the same requests as before.
   
   This is a breaking change. The size sits on the `S3` and `Gcs` variants next 
to `multipart_part_size` because the `Properties` derive needs a key for every 
field of `OpenDalClientConfig`. `OpenDalStorage::Gcs` gains a field and becomes 
`#[non_exhaustive]` like `S3`.
   
   ## Are these changes tested?
   
   Yes, with unit tests that don't need Docker.
   
   - Parsing covers the defaults, the S3 range and the GCS cap. It rejects `0`, 
`1001` and `abc` among others.
   - S3, GCS and memory storages built from one config each get their own size.
   - An S3 storage sends 5 deletes as requests of 2, 2 and 1 when the size is 
2. One test goes through a prefix credential and one through a plain storage. 
Both sent a single request of 5 before this change. The tests point S3 at a 
small local endpoint that counts the keys in each request.
   
   `cargo test -p iceberg-storage-opendal --lib --features opendal-gcs` passes. 
The fs and memory integration tests pass too. Clippy with `-D warnings` is 
clean for the crate with all features and for the `iceberg` lib. rustfmt is 
clean. I didn't run the Docker integration tests.
   
   ## AI Disclosure
   
   Claude Code drafted the code, the tests and this description. The commands 
above were run locally.
   
   Areas worth a close look:
   
   - `OpenDalStorage::Gcs` becomes `#[non_exhaustive]`, which breaks code that 
builds that variant by hand.
   - The plain storage relies on `close` sending the buffered deletes and on a 
new deleter from the same `Operator` being cheap.
   - GCS has parsing and wiring tests only. No test checks its request sizes.
   - The fake S3 endpoint is plain HTTP over a `TcpListener`. It only answers 
`DeleteObjects` and a single `DeleteObject`.
   - I updated both `public-api.txt` files by hand because `cargo-public-api` 
isn't set up here. The Public API CI job checks them.
   


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