iceberg-rust
iceberg-rust copied to clipboard
Do not consume self in Writer Builders
Is your feature request related to a problem or challenge?
As mentioned here: https://github.com/apache/iceberg-rust/pull/1735#discussion_r2428605135
Currently IcebergWriterBuilder, RollingFileWriterBuilder, and FileWriterBuilder all have build(self) and will consume itself when building the writer.
This will force users to clone the builders a lot if they want to use the same configuration for multiple writers.
let writer1 = builder.clone().build();
let writer2 = builder.clone().build();
...
Describe the solution you'd like
Change the builders to have build(&self) so users don't have to clone the builders before building.
Note existing builders use async_trait, so using &self, will probably need more trait bound.
Willingness to contribute
None