pvary commented on PR #14297:
URL: https://github.com/apache/iceberg/pull/14297#issuecomment-4068434311
> If WriterFunction stays schema-only, should the BufferedWriter be created
at a higher level (e.g., in the WriteBuilder before createWriterFunc is called)
and then delegate to the standard WriterFunction once the schema is inferred?
This is how I imagine this today:
```
public class BufferedFileAppender<D> implements FileAppender<D> {
private final int bufferRowCount;
private final Function<List<D>, FileAppender<D>> appenderFactory;
private List<D> buffer;
private FileAppender<D> delegate;
private boolean closed = false;
public BufferedFileAppender(int bufferRowCount, Function<List<D>,
FileAppender<D>> appenderFactory) {
Preconditions.checkArgument(bufferRowCount > 0, "bufferRowCount must be
> 0, got %s", bufferRowCount);
Preconditions.checkNotNull(appenderFactory, "appenderFactory must not be
null");
this.bufferRowCount = bufferRowCount;
this.appenderFactory = appenderFactory;
this.buffer = new ArrayList<>(bufferRowCount);
}
}
```
--
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]