Class ParquetTypeUtils


  • public final class ParquetTypeUtils
    extends Object
    • Method Detail

      • getColumns

        public static List<org.apache.parquet.io.PrimitiveColumnIO> getColumns​(org.apache.parquet.schema.MessageType fileSchema,
                                                                               org.apache.parquet.schema.MessageType requestedSchema)
      • getColumnIO

        public static org.apache.parquet.io.MessageColumnIO getColumnIO​(org.apache.parquet.schema.MessageType fileSchema,
                                                                        org.apache.parquet.schema.MessageType requestedSchema)
      • getMapKeyValueColumn

        public static org.apache.parquet.io.GroupColumnIO getMapKeyValueColumn​(org.apache.parquet.io.GroupColumnIO groupColumnIO)
      • getArrayElementColumn

        public static org.apache.parquet.io.ColumnIO getArrayElementColumn​(org.apache.parquet.io.ColumnIO columnIO)
      • getDescriptors

        public static Map<List<String>,​RichColumnDescriptor> getDescriptors​(org.apache.parquet.schema.MessageType fileSchema,
                                                                                  org.apache.parquet.schema.MessageType requestedSchema)
      • getParquetEncoding

        public static ParquetEncoding getParquetEncoding​(org.apache.parquet.column.Encoding encoding)
      • getParquetTypeByName

        public static org.apache.parquet.schema.Type getParquetTypeByName​(String columnName,
                                                                          org.apache.parquet.schema.GroupType groupType)
      • lookupColumnByName

        public static org.apache.parquet.io.ColumnIO lookupColumnByName​(org.apache.parquet.io.GroupColumnIO groupColumnIO,
                                                                        String columnName)
        Parquet column names are case-sensitive unlike Hive, which converts all column names to lowercase. Therefore, when we look up columns we first check for exact match, and if that fails we look for a case-insensitive match.
      • lookupColumnById

        @Nullable
        public static org.apache.parquet.io.ColumnIO lookupColumnById​(org.apache.parquet.io.GroupColumnIO groupColumnIO,
                                                                      int columnId)
      • isValueNull

        public static boolean isValueNull​(boolean required,
                                          int definitionLevel,
                                          int maxDefinitionLevel)
        For optional fields: definitionLevel == maxDefinitionLevel => Value is defined definitionLevel == maxDefinitionLevel - 1 => Value is null definitionLevel < maxDefinitionLevel - 1 => Value does not exist, because one of its optional parent fields is null
      • getShortDecimalValue

        public static long getShortDecimalValue​(byte[] bytes)
      • getShortDecimalValue

        public static long getShortDecimalValue​(byte[] bytes,
                                                int startOffset,
                                                int length)
      • getLongDecimalValue

        public static io.airlift.slice.Slice getLongDecimalValue​(byte[] bytes)