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 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.
-
Method Summary
Modifier and TypeMethodDescriptionlong
length()
Returns the number of bytes that were currently written by this writer.result()
Returns a result that contains information about writtenDataFile
s orDeleteFile
s.default void
Writes rows to a predefined spec/partition.void
Writes 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 writtenDataFile
s orDeleteFile
s. The result is valid only after the writer is closed.- Returns:
- the file writer result
-