T
- the row typeR
- the result typepublic interface FileWriter<T,R>
extends java.io.Closeable
As opposed to FileAppender
, this interface should be implemented by classes that not
only append records to files but actually produce DataFile
s or DeleteFile
s
objects with Iceberg metadata. Implementations may wrap FileAppender
s with extra
information such as spec, partition, sort order ID needed to construct DataFile
s or
DeleteFile
s.
Modifier and Type | Method and Description |
---|---|
long |
length()
Returns the number of bytes that were currently written by this writer.
|
R |
result()
Returns a result that contains information about written
DataFile s or DeleteFile s. |
default void |
write(java.lang.Iterable<T> rows)
Writes rows to a predefined spec/partition.
|
void |
write(T row)
Writes a row to a predefined spec/partition.
|
default void write(java.lang.Iterable<T> rows)
rows
- data or delete recordsvoid write(T row)
row
- a data or delete recordlong length()
R result()
DataFile
s or DeleteFile
s. The result is valid only after the writer is closed.