Package org.apache.iceberg.io
Interface PartitioningWriter<T,R>
-
- Type Parameters:
T
- the row typeR
- the result type
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
ClusteredDataWriter
,ClusteredEqualityDeleteWriter
,ClusteredPositionDeleteWriter
,FanoutDataWriter
,FanoutPositionOnlyDeleteWriter
public interface PartitioningWriter<T,R> extends java.io.Closeable
A writer capable of writing files of a single type (i.e. data/delete) to multiple specs and partitions.As opposed to
FileWriter
, this interface should be implemented by writers that are not limited to writing to a single spec/partition. Implementations may internally useFileWriter
s for writing to a single spec/partition.Note that this writer can be used both for partitioned and unpartitioned tables.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description R
result()
Returns a result that contains information about writtenDataFile
s orDeleteFile
s.void
write(T row, PartitionSpec spec, StructLike partition)
Writes a row to the provided spec/partition.
-
-
-
Method Detail
-
write
void write(T row, PartitionSpec spec, StructLike partition)
Writes a row to the provided spec/partition.- Parameters:
row
- a data or delete recordspec
- a partition specpartition
- a partition or null if the spec is unpartitioned
-
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 writer result
-
-