Class SchemaEvolution

java.lang.Object
org.apache.orc.impl.SchemaEvolution

public class SchemaEvolution extends Object
Infer and track the evolution between the schema as stored in the file and the schema that has been requested by the reader.
  • Constructor Details

  • Method Details

    • isSchemaEvolutionCaseAware

      public boolean isSchemaEvolutionCaseAware()
    • getReaderSchema

      public TypeDescription getReaderSchema()
    • getReaderBaseSchema

      public TypeDescription 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

      public TypeDescription getFileSchema()
    • getFileType

      public TypeDescription getFileType(TypeDescription readerType)
    • getFileType

      public TypeDescription getFileType(int id)
      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

      public static boolean checkAcidSchema(TypeDescription type)
    • createEventSchema

      public static TypeDescription createEventSchema(TypeDescription typeDescr)
      Parameters:
      typeDescr -
      Returns:
      ORC types for the ACID event based on the row's type description
    • getBaseRow

      public static TypeDescription getBaseRow(TypeDescription typeDescription)
      Get the underlying base row from an ACID event struct.
      Parameters:
      typeDescription - the ACID event schema.
      Returns:
      the subtype for the real row