Search in sources :

Example 1 with HiveWriterVersion

use of io.prestosql.orc.metadata.PostScript.HiveWriterVersion in project hetu-core by openlookeng.

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 rowIndex.getEntryList().stream().map(rowIndexEntry -> toRowGroupIndex(hiveWriterVersion, rowIndexEntry)).collect(toImmutableList());
}
Also used : DOUBLE_VALUE_BYTES(io.prestosql.orc.metadata.statistics.DoubleStatistics.DOUBLE_VALUE_BYTES) LZ4(io.prestosql.orc.metadata.CompressionKind.LZ4) DATE_VALUE_BYTES(io.prestosql.orc.metadata.statistics.DateStatistics.DATE_VALUE_BYTES) CodedInputStream(io.prestosql.orc.protobuf.CodedInputStream) ZSTD(io.prestosql.orc.metadata.CompressionKind.ZSTD) BigDecimal(java.math.BigDecimal) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) Slices(io.airlift.slice.Slices) Map(java.util.Map) SliceUtf8.tryGetCodePointAt(io.airlift.slice.SliceUtf8.tryGetCodePointAt) INTEGER_VALUE_BYTES(io.prestosql.orc.metadata.statistics.IntegerStatistics.INTEGER_VALUE_BYTES) ORC_HIVE_8732(io.prestosql.orc.metadata.PostScript.HiveWriterVersion.ORC_HIVE_8732) Longs(com.google.common.primitives.Longs) OrcTypeKind(io.prestosql.orc.metadata.OrcType.OrcTypeKind) ImmutableMap(com.google.common.collect.ImmutableMap) TimeZone(java.util.TimeZone) DateStatistics(io.prestosql.orc.metadata.statistics.DateStatistics) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) HiveWriterVersion(io.prestosql.orc.metadata.PostScript.HiveWriterVersion) DoubleStatistics(io.prestosql.orc.metadata.statistics.DoubleStatistics) SHORT_DECIMAL_VALUE_BYTES(io.prestosql.orc.metadata.statistics.ShortDecimalStatisticsBuilder.SHORT_DECIMAL_VALUE_BYTES) ZoneId(java.time.ZoneId) NONE(io.prestosql.orc.metadata.CompressionKind.NONE) ByteOrder(java.nio.ByteOrder) DataSize(io.airlift.units.DataSize) List(java.util.List) OrcProto(io.prestosql.orc.proto.OrcProto) ZLIB(io.prestosql.orc.metadata.CompressionKind.ZLIB) Optional(java.util.Optional) MIN_SUPPLEMENTARY_CODE_POINT(java.lang.Character.MIN_SUPPLEMENTARY_CODE_POINT) IntegerStatistics(io.prestosql.orc.metadata.statistics.IntegerStatistics) StripeStatistics(io.prestosql.orc.metadata.statistics.StripeStatistics) Slice(io.airlift.slice.Slice) ColumnEncodingKind(io.prestosql.orc.metadata.ColumnEncoding.ColumnEncodingKind) RowIndexEntry(io.prestosql.orc.proto.OrcProto.RowIndexEntry) DecimalStatistics(io.prestosql.orc.metadata.statistics.DecimalStatistics) GIGABYTE(io.airlift.units.DataSize.Unit.GIGABYTE) ImmutableList(com.google.common.collect.ImmutableList) SNAPPY(io.prestosql.orc.metadata.CompressionKind.SNAPPY) BooleanStatistics(io.prestosql.orc.metadata.statistics.BooleanStatistics) Math.toIntExact(java.lang.Math.toIntExact) SliceUtf8.lengthOfCodePoint(io.airlift.slice.SliceUtf8.lengthOfCodePoint) StreamKind(io.prestosql.orc.metadata.Stream.StreamKind) StringStatistics(io.prestosql.orc.metadata.statistics.StringStatistics) BinaryStatistics(io.prestosql.orc.metadata.statistics.BinaryStatistics) DECIMAL_VALUE_BYTES_OVERHEAD(io.prestosql.orc.metadata.statistics.DecimalStatistics.DECIMAL_VALUE_BYTES_OVERHEAD) ByteString(io.prestosql.orc.protobuf.ByteString) BINARY_VALUE_BYTES_OVERHEAD(io.prestosql.orc.metadata.statistics.BinaryStatistics.BINARY_VALUE_BYTES_OVERHEAD) IOException(java.io.IOException) STRING_VALUE_BYTES_OVERHEAD(io.prestosql.orc.metadata.statistics.StringStatistics.STRING_VALUE_BYTES_OVERHEAD) Strings.emptyToNull(com.google.common.base.Strings.emptyToNull) ORIGINAL(io.prestosql.orc.metadata.PostScript.HiveWriterVersion.ORIGINAL) ColumnStatistics(io.prestosql.orc.metadata.statistics.ColumnStatistics) VisibleForTesting(com.google.common.annotations.VisibleForTesting) BOOLEAN_VALUE_BYTES(io.prestosql.orc.metadata.statistics.BooleanStatistics.BOOLEAN_VALUE_BYTES) HashableBloomFilter(io.prestosql.orc.metadata.statistics.HashableBloomFilter) InputStream(java.io.InputStream) CodedInputStream(io.prestosql.orc.protobuf.CodedInputStream) OrcProto(io.prestosql.orc.proto.OrcProto)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 Strings.emptyToNull (com.google.common.base.Strings.emptyToNull)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 Longs (com.google.common.primitives.Longs)1 Slice (io.airlift.slice.Slice)1 SliceUtf8.lengthOfCodePoint (io.airlift.slice.SliceUtf8.lengthOfCodePoint)1 SliceUtf8.tryGetCodePointAt (io.airlift.slice.SliceUtf8.tryGetCodePointAt)1 Slices (io.airlift.slice.Slices)1 DataSize (io.airlift.units.DataSize)1 GIGABYTE (io.airlift.units.DataSize.Unit.GIGABYTE)1 ColumnEncodingKind (io.prestosql.orc.metadata.ColumnEncoding.ColumnEncodingKind)1 LZ4 (io.prestosql.orc.metadata.CompressionKind.LZ4)1 NONE (io.prestosql.orc.metadata.CompressionKind.NONE)1 SNAPPY (io.prestosql.orc.metadata.CompressionKind.SNAPPY)1 ZLIB (io.prestosql.orc.metadata.CompressionKind.ZLIB)1 ZSTD (io.prestosql.orc.metadata.CompressionKind.ZSTD)1 OrcTypeKind (io.prestosql.orc.metadata.OrcType.OrcTypeKind)1