public interface Writer extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
addRowBatch(VectorizedRowBatch batch)
Add a row batch to the ORC file.
|
void |
addUserMetadata(String key,
ByteBuffer value)
Add arbitrary meta-data to the ORC file.
|
void |
appendStripe(byte[] stripe,
int offset,
int length,
StripeInformation stripeInfo,
OrcProto.StripeStatistics stripeStatistics)
Fast stripe append to ORC file.
|
void |
appendStripe(byte[] stripe,
int offset,
int length,
StripeInformation stripeInfo,
StripeStatistics[] stripeStatistics)
Fast stripe append to ORC file.
|
void |
appendUserMetadata(List<OrcProto.UserMetadataItem> userMetadata)
Deprecated.
use
addUserMetadata(String, ByteBuffer) instead |
void |
close()
Flush all of the buffers and close the file.
|
long |
getNumberOfRows()
Return the number of rows in file.
|
long |
getRawDataSize()
Return the deserialized data size.
|
TypeDescription |
getSchema()
Get the schema for this writer
|
ColumnStatistics[] |
getStatistics()
Get the statistics about the columns in the file.
|
long |
writeIntermediateFooter()
Write an intermediate footer on the file such that if the file is
truncated to the returned offset, it would be a valid ORC file.
|
TypeDescription getSchema()
void addUserMetadata(String key, ByteBuffer value)
key
- a key to label the data with.value
- the contents of the metadata.void addRowBatch(VectorizedRowBatch batch) throws IOException
batch
- the rows to addIOException
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
long getRawDataSize()
long getNumberOfRows()
long writeIntermediateFooter() throws IOException
IOException
void appendStripe(byte[] stripe, int offset, int length, StripeInformation stripeInfo, OrcProto.StripeStatistics stripeStatistics) throws IOException
appendStripe(byte[], int, int, StripeInformation, StripeStatistics[])
for files with encryption.stripe
- - stripe as byte arrayoffset
- - offset within byte arraylength
- - length of stripe within byte arraystripeInfo
- - stripe informationstripeStatistics
- - unencrypted stripe statisticsIOException
void appendStripe(byte[] stripe, int offset, int length, StripeInformation stripeInfo, StripeStatistics[] stripeStatistics) throws IOException
addUserMetadata(String,
ByteBuffer)
to append any user metadata.stripe
- - stripe as byte arrayoffset
- - offset within byte arraylength
- - length of stripe within byte arraystripeInfo
- - stripe informationstripeStatistics
- - stripe statistics with the last one being
for the unencrypted data and the others being for
each encryption variant.IOException
void appendUserMetadata(List<OrcProto.UserMetadataItem> userMetadata)
addUserMetadata(String, ByteBuffer)
insteaduserMetadata
- - user metadataColumnStatistics[] getStatistics() throws IOException
IOException
Copyright © 2013–2021 The Apache Software Foundation. All rights reserved.