public class KeyValueDataFileWriter extends StatsCollectingSingleFileWriter<KeyValue,DataFileMeta>
StatsCollectingSingleFileWriter to write data files containing KeyValues. Also
produces DataFileMeta after writing a file.
NOTE: records given to the writer must be sorted because it does not compare the min max keys
to produce DataFileMeta.
SingleFileWriter.AbortExecutorclosed, fileIO, path| Constructor and Description |
|---|
KeyValueDataFileWriter(FileIO fileIO,
FormatWriterFactory factory,
Path path,
java.util.function.Function<KeyValue,InternalRow> converter,
RowType keyType,
RowType valueType,
SimpleStatsExtractor simpleStatsExtractor,
long schemaId,
int level,
String compression,
CoreOptions options,
FileSource fileSource) |
| Modifier and Type | Method and Description |
|---|---|
DataFileMeta |
result() |
void |
write(KeyValue kv)
Add only one record to this file writer.
|
fieldStats, writeBundleabort, abortExecutor, close, path, reachTargetSize, recordCount, writeImplclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, writepublic KeyValueDataFileWriter(FileIO fileIO, FormatWriterFactory factory, Path path, java.util.function.Function<KeyValue,InternalRow> converter, RowType keyType, RowType valueType, @Nullable SimpleStatsExtractor simpleStatsExtractor, long schemaId, int level, String compression, CoreOptions options, FileSource fileSource)
public void write(KeyValue kv) throws IOException
FileWriterNOTE: If any exception occurs during writing, the writer should clean up useless files for the user.
write in interface FileWriter<KeyValue,DataFileMeta>write in class StatsCollectingSingleFileWriter<KeyValue,DataFileMeta>kv - to write.IOException - if encounter any IO error.@Nullable public DataFileMeta result() throws IOException
IOExceptionCopyright © 2023–2024 The Apache Software Foundation. All rights reserved.