Package org.apache.orc.impl
Class SchemaEvolution
java.lang.Object
org.apache.orc.impl.SchemaEvolution
Infer and track the evolution between the schema as stored in the file and
the schema that has been requested by the reader.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionSchemaEvolution
(TypeDescription fileSchema, boolean[] readerIncluded) Deprecated.SchemaEvolution
(TypeDescription fileSchema, TypeDescription readerSchema, boolean[] readerIncluded) Deprecated.SchemaEvolution
(TypeDescription fileSchema, TypeDescription readerSchema, Reader.Options options) -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static TypeDescription
createEventSchema
(TypeDescription typeDescr) static TypeDescription
getBaseRow
(TypeDescription typeDescription) Get the underlying base row from an ACID event struct.boolean[]
Get whether each column is included from the file's point of view.getFileType
(int id) Get the file type by reader type id.getFileType
(TypeDescription readerType) boolean
Get whether the columns are handled via position or nameReturns the non-ACID (aka base) reader type description.boolean[]
Get whether each column is included from the reader's point of view.boolean
Is there Schema Evolution data type conversion?boolean
includeReaderColumn
(int readerId) Should we read the given reader column?boolean
When there Schema Evolution data type conversion i.e.boolean
isPPDSafeConversion
(int fileColId) Check if column is safe for ppd evaluationboolean
-
Constructor Details
-
SchemaEvolution
public SchemaEvolution(TypeDescription fileSchema, TypeDescription readerSchema, Reader.Options options) -
SchemaEvolution
Deprecated. -
SchemaEvolution
@Deprecated public SchemaEvolution(TypeDescription fileSchema, TypeDescription readerSchema, boolean[] readerIncluded) Deprecated.
-
-
Method Details
-
isSchemaEvolutionCaseAware
public boolean isSchemaEvolutionCaseAware() -
getReaderSchema
-
getReaderBaseSchema
Returns the non-ACID (aka base) reader type description.- Returns:
- the reader type ignoring the ACID rowid columns, if any
-
hasConversion
public boolean hasConversion()Is there Schema Evolution data type conversion?- Returns:
-
isOnlyImplicitConversion
public boolean isOnlyImplicitConversion()When there Schema Evolution data type conversion i.e. hasConversion() returns true, is the conversion only the implicit kind? (see aaa).- Returns:
-
getFileSchema
-
getFileType
-
getFileType
Get the file type by reader type id.- Parameters:
id
- reader column id- Returns:
-
getReaderIncluded
public boolean[] getReaderIncluded()Get whether each column is included from the reader's point of view.- Returns:
- a boolean array indexed by reader column id
-
getFileIncluded
public boolean[] getFileIncluded()Get whether each column is included from the file's point of view.- Returns:
- a boolean array indexed by file column id
-
getPositionalColumns
public boolean getPositionalColumns()Get whether the columns are handled via position or name -
isPPDSafeConversion
public boolean isPPDSafeConversion(int fileColId) Check if column is safe for ppd evaluation- Parameters:
fileColId
- file column id- Returns:
- true if the specified column is safe for ppd evaluation else false
-
includeReaderColumn
public boolean includeReaderColumn(int readerId) Should we read the given reader column?- Parameters:
readerId
- the id of column in the extended reader schema- Returns:
- true if the column should be read
-
checkAcidSchema
-
createEventSchema
- Parameters:
typeDescr
-- Returns:
- ORC types for the ACID event based on the row's type description
-
getBaseRow
Get the underlying base row from an ACID event struct.- Parameters:
typeDescription
- the ACID event schema.- Returns:
- the subtype for the real row
-