Package org.apache.iceberg.io
Class DataWriter<T>
java.lang.Object
org.apache.iceberg.io.DataWriter<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,FileWriter<T,DataWriteResult>
-
Constructor Summary
ConstructorsConstructorDescriptionDataWriter(FileAppender<T> appender, FileFormat format, String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata) DataWriter(FileAppender<T> appender, FileFormat format, String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata, SortOrder sortOrder) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longlength()Returns the number of bytes that were currently written by this writer.result()Returns a result that contains information about writtenDataFiles orDeleteFiles.voidWrites a row to a predefined spec/partition.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iceberg.io.FileWriter
write
-
Constructor Details
-
DataWriter
public DataWriter(FileAppender<T> appender, FileFormat format, String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata) -
DataWriter
public DataWriter(FileAppender<T> appender, FileFormat format, String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata, SortOrder sortOrder)
-
-
Method Details
-
write
Description copied from interface:FileWriterWrites a row to a predefined spec/partition.- Specified by:
writein interfaceFileWriter<T,DataWriteResult> - Parameters:
row- a data or delete record
-
length
public long length()Description copied from interface:FileWriterReturns the number of bytes that were currently written by this writer.- Specified by:
lengthin interfaceFileWriter<T,DataWriteResult> - Returns:
- the number of written bytes
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toDataFile
-
result
Description copied from interface:FileWriterReturns a result that contains information about writtenDataFiles orDeleteFiles. The result is valid only after the writer is closed.- Specified by:
resultin interfaceFileWriter<T,DataWriteResult> - Returns:
- the file writer result
-