Context
I'm working on writing data to R2 Data Catalog (https://developers.cloudflare.com/r2/data-catalog/) with iceberg-rust (I'm on the R2 Data Catalog team).
Problem
When writing large files into the Iceberg table , I get the following error:
S3Error { code: "InvalidPart", message: "All non-trailing parts must have the same length.", resource: "", request_id: "" }
I had traced the problem to OpenDAL, and opened an issue there: apache/opendal#6252.
Desired Result
Writing large files (files large enough to require a multipart upload) to an Iceberg Table hosted in Cloudflare R2 should succeed.
A possible solution seems to be to add a chunk() to the writer process to ensure each uploaded part (aside from the last) has the same size.