liurenjie1024 commented on issue #1650:
URL: https://github.com/apache/iceberg-rust/issues/1650#issuecomment-3257868009

   Thanks @CTTY for raising this. I agree that the current writer class 
hierarchy is somehow cumbersome and over complicated. I plan to do a 
refactoring after the `FileFormat` api proposal got merged.
   
   For now I would suggest to make the changes minimum. So here is what's in my 
mind:
   
   1.Adding one layer: `PartitioningWriter`, which sould like
   ```
   pub trait PartitioningWriter {
       fn write(&self, partition_key: PartitionKey, batch: RecordBatch);
   }
   
   struct ClusterdPartitioningWriter {...}
   
   impl PartitioningWriter for ClusterdPartitioningWriter {}
   
   struct FanoutParritioningWriter {
      writers: HashMap<Struct, RollingFileWriter>
   ....
   }
   
   impl PartitioningWriter for FanoutParritioningWriter {}
   ```
   
   2. Remove the `FileWriter` trait from `RollingFileWriter`
   3. Move the `LocationGenerator` and `FilenameGenerator` to 
`RollingFileWriter`
   4. Change `FileWriterBuilder` trait to accept an `OutputFile` to build 
`FileWriter`
   
   
   WDYT?
   
   


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to