public class OrcBulkWriter extends Object implements FormatWriter
FormatWriter
implementation that writes data in ORC format.Constructor and Description |
---|
OrcBulkWriter(Vectorizer<InternalRow> vectorizer,
org.apache.orc.Writer writer,
PositionOutputStream underlyingStream,
int batchSize) |
Modifier and Type | Method and Description |
---|---|
void |
addElement(InternalRow element)
Adds an element to the encoder.
|
void |
close() |
boolean |
reachTargetSize(boolean suggestedCheck,
long targetSize)
Check if the writer has reached the
targetSize . |
public OrcBulkWriter(Vectorizer<InternalRow> vectorizer, org.apache.orc.Writer writer, PositionOutputStream underlyingStream, int batchSize)
public void addElement(InternalRow element) throws IOException
FormatWriter
It may be that adding this element fills up an internal buffer and causes the encoding and flushing of a batch of internally buffered elements.
addElement
in interface FormatWriter
element
- The element to add.IOException
- Thrown, if the element cannot be added to the encoder, or if the output
stream throws an exception.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public boolean reachTargetSize(boolean suggestedCheck, long targetSize) throws IOException
FormatWriter
targetSize
.reachTargetSize
in interface FormatWriter
suggestedCheck
- Whether it needs to be checked, but subclasses can also decide whether
to check it themselves.targetSize
- The size of the target.IOException
- Thrown if calculating the length fails.Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.