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

org.apache.orc

## Class OrcUtils

- java.lang.Object
- - org.apache.orc.OrcUtils

-     public class OrcUtils
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OrcUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static List<StripeInformation>` | `convertProtoStripesToStripes(List<OrcProto.StripeInformation> stripes)`
    `static TypeDescription` | `convertTypeFromProtobuf(List<OrcProto.Type> types, int rootColumn)` Translate the given rootColumn from the list of types to a TypeDescription.
    `static List<OrcProto.Type>` | `getOrcTypes(TypeDescription typeDescr)`
    `static boolean[]` | `includeColumns(String selectedColumns, TypeDescription schema)` Returns selected columns as a boolean array with true value set for specified column names.
    `static int` | `isValidTypeTree(List<OrcProto.Type> types, int root)` Checks whether the list of protobuf types from the file are valid or not.

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

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

- - ### Constructor Detail

    - #### OrcUtils

          public OrcUtils()

  - ### Method Detail

    - #### includeColumns

          public static boolean[] includeColumns(String selectedColumns,
                                                 TypeDescription schema)

      Returns selected columns as a boolean array with true value set for specified column names. The result will contain number of elements equal to flattened number of columns. For example: selectedColumns - a,b,c allColumns - a,b,c,d If column c is a complex type, say list<string> and other types are primitives then result will be [false, true, true, true, true, true, false] Index 0 is the root element of the struct which is set to false by default, index 1,2 corresponds to columns a and b. Index 3,4 correspond to column c which is list<string> and index 5 correspond to column d. After flattening list<string> gets 2 columns. Column names that aren't found are ignored.
      Parameters:
        `selectedColumns` - - comma separated list of selected column names
        `schema` - - object schema
      Returns:
        - boolean array with true value set for the specified column names

    - #### getOrcTypes

          public static List<OrcProto.Type> getOrcTypes(TypeDescription typeDescr)

    - #### isValidTypeTree

          public static int isValidTypeTree(List<OrcProto.Type> types,
                                            int root)
                                     throws IOException

      Checks whether the list of protobuf types from the file are valid or not.
      Parameters:
        `types` - the list of types from the protobuf
        `root` - the top of the tree to check
      Returns:
        the next available id
      Throws:
        `IOException` - if the tree is invalid

    - #### convertTypeFromProtobuf

          public static TypeDescription convertTypeFromProtobuf(List<OrcProto.Type> types,
                                                                int rootColumn)
                                                         throws FileFormatException

      Translate the given rootColumn from the list of types to a TypeDescription.
      Parameters:
        `types` - all of the types
        `rootColumn` - translate this type
      Returns:
        a new TypeDescription that matches the given rootColumn
      Throws:
        `FileFormatException`

    - #### convertProtoStripesToStripes

          public static List<StripeInformation> convertProtoStripesToStripes(List<OrcProto.StripeInformation> stripes)

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