Package org.apache.orc.impl.writer
Interface WriterContext
public interface WriterContext
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Should be building the row index.createStream
(StreamName name) Create a stream to store part of a column.boolean[]
Get the bloom filter columnsdouble
Get bloom filter false positive percentage.Deprecated.Get the writer's configuration.double
getDictionaryKeySizeThreshold
(int columnId) Get the dictionary key size threshold.Get the encoding strategy to use.getEncryption
(int columnId) Get the encryption for the given column.Get the PhysicalWriter.boolean
Should we write the data using the proleptic Gregorian calendar?int
Get the stride rate of the row index.getUnencryptedMask
(int columnId) Get the mask for the unencrypted variant.boolean
Should the writer use UTC as the timezone?Get the version of the file to write.boolean
Is the ORC file compressed?void
setEncoding
(int column, WriterEncryptionVariant variant, OrcProto.ColumnEncoding encoding) Set the encoding for the current stripe.void
writeBloomFilter
(StreamName name, OrcProto.BloomFilterIndex.Builder bloom) void
writeIndex
(StreamName name, OrcProto.RowIndex.Builder index) void
writeStatistics
(StreamName name, OrcProto.ColumnStatistics.Builder stats) Set the column statistics for the stripe or file.
-
Method Details
-
createStream
Create a stream to store part of a column.- Parameters:
name
- the name of the stream- Returns:
- The output outStream that the section needs to be written to.
- Throws:
IOException
-
getRowIndexStride
int getRowIndexStride()Get the stride rate of the row index. -
buildIndex
boolean buildIndex()Should be building the row index.- Returns:
- true if we are building the index
-
isCompressed
boolean isCompressed()Is the ORC file compressed?- Returns:
- are the streams compressed
-
getEncodingStrategy
OrcFile.EncodingStrategy getEncodingStrategy()Get the encoding strategy to use.- Returns:
- encoding strategy
-
getBloomFilterColumns
boolean[] getBloomFilterColumns()Get the bloom filter columns- Returns:
- bloom filter columns
-
getBloomFilterFPP
double getBloomFilterFPP()Get bloom filter false positive percentage.- Returns:
- fpp
-
getConfiguration
Configuration getConfiguration()Get the writer's configuration.- Returns:
- configuration
-
getVersion
OrcFile.Version getVersion()Get the version of the file to write. -
getBloomFilterVersion
Deprecated. -
writeIndex
- Throws:
IOException
-
writeBloomFilter
- Throws:
IOException
-
getUnencryptedMask
Get the mask for the unencrypted variant.- Parameters:
columnId
- the column id- Returns:
- the mask to apply to the unencrypted data or null if there is none
-
getEncryption
Get the encryption for the given column.- Parameters:
columnId
- the root column id- Returns:
- the column encryption or null if it isn't encrypted
-
getPhysicalWriter
PhysicalWriter getPhysicalWriter()Get the PhysicalWriter.- Returns:
- the file's physical writer.
-
setEncoding
Set the encoding for the current stripe.- Parameters:
column
- the column identifiervariant
- the encryption variantencoding
- the encoding for this stripe
-
writeStatistics
Set the column statistics for the stripe or file.- Parameters:
name
- the name of the statistics streamstats
- the statistics for this column in this stripe- Throws:
IOException
-
getUseUTCTimestamp
boolean getUseUTCTimestamp()Should the writer use UTC as the timezone? -
getDictionaryKeySizeThreshold
double getDictionaryKeySizeThreshold(int columnId) Get the dictionary key size threshold.- Parameters:
columnId
- the column id- Returns:
- the minimum ratio for using a dictionary
-
getProlepticGregorian
boolean getProlepticGregorian()Should we write the data using the proleptic Gregorian calendar?- Returns:
- true if we should use the proleptic Gregorian calendar
-