SchemaEvolution (ORC Core 1.6.6 API)
Date: 2021-01-13

org.apache.orc.impl

## 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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SchemaEvolution.IllegalEvolutionException`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SchemaEvolution(TypeDescription fileSchema, boolean[] readerIncluded)` Deprecated.
    `SchemaEvolution(TypeDescription fileSchema, TypeDescription readerSchema, boolean[] readerIncluded)` Deprecated.
    `SchemaEvolution(TypeDescription fileSchema, TypeDescription readerSchema, Reader.Options options)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `checkAcidSchema(TypeDescription type)`
    `static TypeDescription` | `createEventSchema(TypeDescription typeDescr)`
    `static TypeDescription` | `getBaseRow(TypeDescription typeDescription)` Get the underlying base row from an ACID event struct.
    `boolean[]` | `getFileIncluded()` Get whether each column is included from the file's point of view.
    `TypeDescription` | `getFileSchema()`
    `TypeDescription` | `getFileType(int id)` Get the file type by reader type id.
    `TypeDescription` | `getFileType(TypeDescription readerType)`
    `boolean` | `getPositionalColumns()` Get whether the columns are handled via position or name
    `TypeDescription` | `getReaderBaseSchema()` Returns the non-ACID (aka base) reader type description.
    `boolean[]` | `getReaderIncluded()` Get whether each column is included from the reader's point of view.
    `TypeDescription` | `getReaderSchema()`
    `boolean` | `hasConversion()` Is there Schema Evolution data type conversion?
    `boolean` | `includeReaderColumn(int readerId)` Should we read the given reader column?
    `boolean` | `isOnlyImplicitConversion()` When there Schema Evolution data type conversion i.e.
    `boolean` | `isPPDSafeConversion(int colId)` Check if column is safe for ppd evaluation

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SchemaEvolution

          public SchemaEvolution(TypeDescription fileSchema,
                                 TypeDescription readerSchema,
                                 Reader.Options options)

    - #### SchemaEvolution

          @Deprecated
          public SchemaEvolution(TypeDescription fileSchema,
                                             boolean[] readerIncluded)

      Deprecated.

    - #### SchemaEvolution

          @Deprecated
          public SchemaEvolution(TypeDescription fileSchema,
                                             TypeDescription readerSchema,
                                             boolean[] readerIncluded)

      Deprecated.

  - ### Method Detail

    - #### 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 colId)

      Check if column is safe for ppd evaluation
      Parameters:
        `colId` - reader 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

Copyright © 2013–2021 The Apache Software Foundation. All rights reserved.