ConvertTreeReaderFactory (ORC Core 1.6.5 API)
Date: 2020-10-01

org.apache.orc.impl

## Class ConvertTreeReaderFactory

- java.lang.Object
- - org.apache.orc.impl.TreeReaderFactory
  - - org.apache.orc.impl.ConvertTreeReaderFactory

-     public class ConvertTreeReaderFactory
      extends TreeReaderFactory

  Convert ORC tree readers.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ConvertTreeReaderFactory.AnyIntegerFromAnyIntegerTreeReader`
    `static class` | `ConvertTreeReaderFactory.AnyIntegerFromDecimalTreeReader`
    `static class` | `ConvertTreeReaderFactory.AnyIntegerFromDoubleTreeReader`
    `static class` | `ConvertTreeReaderFactory.AnyIntegerFromStringGroupTreeReader`
    `static class` | `ConvertTreeReaderFactory.AnyIntegerFromTimestampTreeReader`
    `static class` | `ConvertTreeReaderFactory.ConvertTreeReader` Override methods like checkEncoding to pass-thru to the convert TreeReader.
    `static class` | `ConvertTreeReaderFactory.DateFromStringGroupTreeReader`
    `static class` | `ConvertTreeReaderFactory.DateFromTimestampTreeReader`
    `static class` | `ConvertTreeReaderFactory.DecimalFromAnyIntegerTreeReader`
    `static class` | `ConvertTreeReaderFactory.DecimalFromDecimalTreeReader`
    `static class` | `ConvertTreeReaderFactory.DecimalFromDoubleTreeReader`
    `static class` | `ConvertTreeReaderFactory.DecimalFromStringGroupTreeReader`
    `static class` | `ConvertTreeReaderFactory.DecimalFromTimestampTreeReader`
    `static class` | `ConvertTreeReaderFactory.DoubleFromAnyIntegerTreeReader`
    `static class` | `ConvertTreeReaderFactory.DoubleFromDecimalTreeReader`
    `static class` | `ConvertTreeReaderFactory.DoubleFromStringGroupTreeReader`
    `static class` | `ConvertTreeReaderFactory.DoubleFromTimestampTreeReader`
    `static class` | `ConvertTreeReaderFactory.FloatFromDoubleTreeReader`
    `static class` | `ConvertTreeReaderFactory.StringGroupFromAnyIntegerTreeReader`
    `static class` | `ConvertTreeReaderFactory.StringGroupFromBinaryTreeReader`
    `static class` | `ConvertTreeReaderFactory.StringGroupFromBooleanTreeReader`
    `static class` | `ConvertTreeReaderFactory.StringGroupFromDateTreeReader`
    `static class` | `ConvertTreeReaderFactory.StringGroupFromDecimalTreeReader`
    `static class` | `ConvertTreeReaderFactory.StringGroupFromDoubleTreeReader`
    `static class` | `ConvertTreeReaderFactory.StringGroupFromStringGroupTreeReader`
    `static class` | `ConvertTreeReaderFactory.StringGroupFromTimestampTreeReader`
    `static class` | `ConvertTreeReaderFactory.TimestampFromAnyIntegerTreeReader`
    `static class` | `ConvertTreeReaderFactory.TimestampFromDateTreeReader`
    `static class` | `ConvertTreeReaderFactory.TimestampFromDecimalTreeReader`
    `static class` | `ConvertTreeReaderFactory.TimestampFromDoubleTreeReader`
    `static class` | `ConvertTreeReaderFactory.TimestampFromStringGroupTreeReader`

    - ### Nested classes/interfaces inherited from class org.apache.orc.impl.TreeReaderFactory

      `TreeReaderFactory.BinaryTreeReader, TreeReaderFactory.BooleanTreeReader, TreeReaderFactory.BytesColumnVectorUtil, TreeReaderFactory.ByteTreeReader, TreeReaderFactory.CharTreeReader, TreeReaderFactory.Context, TreeReaderFactory.DateTreeReader, TreeReaderFactory.Decimal64TreeReader, TreeReaderFactory.DecimalTreeReader, TreeReaderFactory.DoubleTreeReader, TreeReaderFactory.FloatTreeReader, TreeReaderFactory.IntTreeReader, TreeReaderFactory.ListTreeReader, TreeReaderFactory.LongTreeReader, TreeReaderFactory.MapTreeReader, TreeReaderFactory.NullTreeReader, TreeReaderFactory.ReaderContext, TreeReaderFactory.ShortTreeReader, TreeReaderFactory.StringDictionaryTreeReader, TreeReaderFactory.StringDirectTreeReader, TreeReaderFactory.StringTreeReader, TreeReaderFactory.StructTreeReader, TreeReaderFactory.TimestampTreeReader, TreeReaderFactory.TreeReader, TreeReaderFactory.UnionTreeReader, TreeReaderFactory.VarcharTreeReader`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConvertTreeReaderFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `canConvert(TypeDescription fileType, TypeDescription readerType)`
    `static TreeReaderFactory.TreeReader` | `createConvertTreeReader(TypeDescription readerType, TreeReaderFactory.Context context)` (Rules from Hive's PrimitiveObjectInspectorUtils conversion) To BOOLEAN, BYTE, SHORT, INT, LONG: Convert from (BOOLEAN, BYTE, SHORT, INT, LONG) with down cast if necessary.

    - ### Methods inherited from class org.apache.orc.impl.TreeReaderFactory

      `createTreeReader`

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

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

- - ### Constructor Detail

    - #### ConvertTreeReaderFactory

          public ConvertTreeReaderFactory()

  - ### Method Detail

    - #### createConvertTreeReader

          public static TreeReaderFactory.TreeReader createConvertTreeReader(TypeDescription readerType,
                                                                             TreeReaderFactory.Context context)
                                                                      throws IOException

      (Rules from Hive's PrimitiveObjectInspectorUtils conversion) To BOOLEAN, BYTE, SHORT, INT, LONG: Convert from (BOOLEAN, BYTE, SHORT, INT, LONG) with down cast if necessary. Convert from (FLOAT, DOUBLE) using type cast to long and down cast if necessary. Convert from DECIMAL from longValue and down cast if necessary. Convert from STRING using LazyLong.parseLong and down cast if necessary. Convert from (CHAR, VARCHAR) from Integer.parseLong and down cast if necessary. Convert from TIMESTAMP using timestamp getSeconds and down cast if necessary. AnyIntegerFromAnyIntegerTreeReader (written) AnyIntegerFromFloatTreeReader (written) AnyIntegerFromDoubleTreeReader (written) AnyIntegerFromDecimalTreeReader (written) AnyIntegerFromStringGroupTreeReader (written) AnyIntegerFromTimestampTreeReader (written) To FLOAT/DOUBLE: Convert from (BOOLEAN, BYTE, SHORT, INT, LONG) using cast Convert from FLOAT using cast Convert from DECIMAL using getDouble Convert from (STRING, CHAR, VARCHAR) using Double.parseDouble Convert from TIMESTAMP using timestamp getDouble FloatFromAnyIntegerTreeReader (existing) FloatFromDoubleTreeReader (written) FloatFromDecimalTreeReader (written) FloatFromStringGroupTreeReader (written) DoubleFromAnyIntegerTreeReader (existing) DoubleFromFloatTreeReader (existing) DoubleFromDecimalTreeReader (written) DoubleFromStringGroupTreeReader (written) To DECIMAL: Convert from (BOOLEAN, BYTE, SHORT, INT, LONG) using to HiveDecimal.create() Convert from (FLOAT, DOUBLE) using to HiveDecimal.create(string value) Convert from (STRING, CHAR, VARCHAR) using HiveDecimal.create(string value) Convert from TIMESTAMP using HiveDecimal.create(string value of timestamp getDouble) DecimalFromAnyIntegerTreeReader (existing) DecimalFromFloatTreeReader (existing) DecimalFromDoubleTreeReader (existing) DecimalFromStringGroupTreeReader (written) To STRING, CHAR, VARCHAR: Convert from (BOOLEAN, BYTE, SHORT, INT, LONG) using to string conversion Convert from (FLOAT, DOUBLE) using to string conversion Convert from DECIMAL using HiveDecimal.toString Convert from CHAR by stripping pads Convert from VARCHAR with value Convert from TIMESTAMP using Timestamp.toString Convert from DATE using Date.toString Convert from BINARY using Text.decode StringGroupFromAnyIntegerTreeReader (written) StringGroupFromFloatTreeReader (written) StringGroupFromDoubleTreeReader (written) StringGroupFromDecimalTreeReader (written) String from Char/Varchar conversion Char from String/Varchar conversion Varchar from String/Char conversion StringGroupFromTimestampTreeReader (written) StringGroupFromDateTreeReader (written) StringGroupFromBinaryTreeReader ***** To TIMESTAMP: Convert from (BOOLEAN, BYTE, SHORT, INT, LONG) using TimestampWritable.longToTimestamp Convert from (FLOAT, DOUBLE) using TimestampWritable.doubleToTimestamp Convert from DECIMAL using TimestampWritable.decimalToTimestamp Convert from (STRING, CHAR, VARCHAR) using string conversion Or, from DATE TimestampFromAnyIntegerTreeReader (written) TimestampFromFloatTreeReader (written) TimestampFromDoubleTreeReader (written) TimestampFromDecimalTreeeReader (written) TimestampFromStringGroupTreeReader (written) TimestampFromDateTreeReader To DATE: Convert from (STRING, CHAR, VARCHAR) using string conversion. Or, from TIMESTAMP. DateFromStringGroupTreeReader (written) DateFromTimestampTreeReader (written) To BINARY: Convert from (STRING, CHAR, VARCHAR) using getBinaryFromText BinaryFromStringGroupTreeReader (written) (Notes from StructConverter) To STRUCT: Input must be data type STRUCT minFields = Math.min(numSourceFields, numTargetFields) Convert those fields Extra targetFields to NULL (Notes from ListConverter) To LIST: Input must be data type LIST Convert elements (Notes from MapConverter) To MAP: Input must be data type MAP Convert keys and values (Notes from UnionConverter) To UNION: Input must be data type UNION Convert value for tag
      Parameters:
        `readerType` -
      Returns:
      Throws:
        `IOException`

    - #### canConvert

          public static boolean canConvert(TypeDescription fileType,
                                           TypeDescription readerType)

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