Search in sources :

Example 1 with RowIndexEntry

use of com.facebook.presto.orc.proto.OrcProto.RowIndexEntry in project presto by prestodb.

the class OrcMetadataReader method readRowIndexes.

@Override
public List<RowGroupIndex> readRowIndexes(HiveWriterVersion hiveWriterVersion, InputStream inputStream) throws IOException {
    CodedInputStream input = CodedInputStream.newInstance(inputStream);
    OrcProto.RowIndex rowIndex = OrcProto.RowIndex.parseFrom(input);
    return ImmutableList.copyOf(Iterables.transform(rowIndex.getEntryList(), rowIndexEntry -> toRowGroupIndex(hiveWriterVersion, rowIndexEntry)));
}
Also used : ORIGINAL(com.facebook.presto.orc.metadata.PostScript.HiveWriterVersion.ORIGINAL) Iterables(com.google.common.collect.Iterables) Slice(io.airlift.slice.Slice) Logger(io.airlift.log.Logger) OrcTypeKind(com.facebook.presto.orc.metadata.OrcType.OrcTypeKind) BigDecimal(java.math.BigDecimal) ZLIB(com.facebook.presto.orc.metadata.CompressionKind.ZLIB) GIGABYTE(io.airlift.units.DataSize.Unit.GIGABYTE) ImmutableList(com.google.common.collect.ImmutableList) HiveWriterVersion(com.facebook.presto.orc.metadata.PostScript.HiveWriterVersion) Slices(io.airlift.slice.Slices) Map(java.util.Map) Math.toIntExact(java.lang.Math.toIntExact) StreamKind(com.facebook.presto.orc.metadata.Stream.StreamKind) ORC_HIVE_8732(com.facebook.presto.orc.metadata.PostScript.HiveWriterVersion.ORC_HIVE_8732) UNCOMPRESSED(com.facebook.presto.orc.metadata.CompressionKind.UNCOMPRESSED) ImmutableMap(com.google.common.collect.ImmutableMap) ColumnEncodingKind(com.facebook.presto.orc.metadata.ColumnEncoding.ColumnEncodingKind) RowIndexEntry(com.facebook.presto.orc.proto.OrcProto.RowIndexEntry) SNAPPY(com.facebook.presto.orc.metadata.CompressionKind.SNAPPY) IOException(java.io.IOException) Preconditions.checkState(com.google.common.base.Preconditions.checkState) DataSize(io.airlift.units.DataSize) List(java.util.List) CodedInputStream(com.facebook.presto.orc.protobuf.CodedInputStream) OrcProto(com.facebook.presto.orc.proto.OrcProto) Optional(java.util.Optional) VisibleForTesting(com.google.common.annotations.VisibleForTesting) MIN_SURROGATE(java.lang.Character.MIN_SURROGATE) InputStream(java.io.InputStream) CodedInputStream(com.facebook.presto.orc.protobuf.CodedInputStream) OrcProto(com.facebook.presto.orc.proto.OrcProto)

Aggregations

ColumnEncodingKind (com.facebook.presto.orc.metadata.ColumnEncoding.ColumnEncodingKind)1 SNAPPY (com.facebook.presto.orc.metadata.CompressionKind.SNAPPY)1 UNCOMPRESSED (com.facebook.presto.orc.metadata.CompressionKind.UNCOMPRESSED)1 ZLIB (com.facebook.presto.orc.metadata.CompressionKind.ZLIB)1 OrcTypeKind (com.facebook.presto.orc.metadata.OrcType.OrcTypeKind)1 HiveWriterVersion (com.facebook.presto.orc.metadata.PostScript.HiveWriterVersion)1 ORC_HIVE_8732 (com.facebook.presto.orc.metadata.PostScript.HiveWriterVersion.ORC_HIVE_8732)1 ORIGINAL (com.facebook.presto.orc.metadata.PostScript.HiveWriterVersion.ORIGINAL)1 StreamKind (com.facebook.presto.orc.metadata.Stream.StreamKind)1 OrcProto (com.facebook.presto.orc.proto.OrcProto)1 RowIndexEntry (com.facebook.presto.orc.proto.OrcProto.RowIndexEntry)1 CodedInputStream (com.facebook.presto.orc.protobuf.CodedInputStream)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Preconditions.checkState (com.google.common.base.Preconditions.checkState)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 Iterables (com.google.common.collect.Iterables)1 Logger (io.airlift.log.Logger)1 Slice (io.airlift.slice.Slice)1 Slices (io.airlift.slice.Slices)1