public class KeyValueDataFileWriter extends StatsCollectingSingleFileWriter<KeyValue,DataFileMeta>
StatsCollectingSingleFileWriter
to write data files containing KeyValue
s. 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.AbortExecutor
closed, 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,
FileIndexOptions fileIndexOptions) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
DataFileMeta |
result() |
void |
write(KeyValue kv)
Add only one record to this file writer.
|
fieldStats, writeBundle
abort, abortExecutor, path, reachTargetSize, recordCount, writeImpl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write, write, write
public 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, FileIndexOptions fileIndexOptions)
public void write(KeyValue kv) throws IOException
FileWriter
NOTE: 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
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class SingleFileWriter<KeyValue,DataFileMeta>
IOException
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.