Package org.apache.iceberg.io
Interface FileWriter<T,R>
- Type Parameters:
T- the row typeR- the result type
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DataWriter,EqualityDeleteWriter,FileScopedPositionDeleteWriter,PositionDeleteWriter,RollingDataWriter,RollingEqualityDeleteWriter,RollingPositionDeleteWriter,SortingPositionOnlyDeleteWriter
A writer capable of writing files of a single type (i.e. data/delete) to one spec/partition.
As opposed to FileAppender, this interface should be implemented by classes that not
only append records to files but actually produce DataFiles or DeleteFiles
objects with Iceberg metadata. Implementations may wrap FileAppenders with extra
information such as spec, partition, sort order ID needed to construct DataFiles or
DeleteFiles.
-
Method Summary
Modifier and TypeMethodDescriptionlonglength()Returns the number of bytes that were currently written by this writer.result()Returns a result that contains information about writtenDataFiles orDeleteFiles.default voidWrites rows to a predefined spec/partition.voidWrites a row to a predefined spec/partition.
-
Method Details
-
write
Writes rows to a predefined spec/partition.- Parameters:
rows- data or delete records
-
write
Writes a row to a predefined spec/partition.- Parameters:
row- a data or delete record
-
length
long length()Returns the number of bytes that were currently written by this writer.- Returns:
- the number of written bytes
-
result
R result()Returns a result that contains information about writtenDataFiles orDeleteFiles. The result is valid only after the writer is closed.- Returns:
- the file writer result
-