Skip to content

Commit

Permalink
Avoid using some deprecated methods of Parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
takezoe authored and raunaqmorarka committed May 25, 2024
1 parent 09942f8 commit af0ccdd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static ColumnChunkMetadata get(
PrimitiveTypeName type,
CompressionCodecName codec,
Set<Encoding> encodings,
Statistics statistics,
Statistics<?> statistics,
long firstDataPage,
long dictionaryPageOffset,
long valueCount,
Expand All @@ -74,7 +74,7 @@ public static ColumnChunkMetadata get(
CompressionCodecName codec,
EncodingStats encodingStats,
Set<Encoding> encodings,
Statistics statistics,
Statistics<?> statistics,
long firstDataPage,
long dictionaryPageOffset,
long valueCount,
Expand All @@ -91,7 +91,7 @@ public static ColumnChunkMetadata get(
CompressionCodecName codec,
EncodingStats encodingStats,
Set<Encoding> encodings,
Statistics statistics,
Statistics<?> statistics,
long firstDataPage,
long dictionaryPageOffset,
long valueCount,
Expand Down Expand Up @@ -186,7 +186,7 @@ public ColumnPath getPath()
public PrimitiveTypeName getType()
{
decryptIfNeeded();
return properties.getType();
return properties.getPrimitiveType().getPrimitiveTypeName();
}

public PrimitiveType getPrimitiveType()
Expand All @@ -205,7 +205,7 @@ public PrimitiveType getPrimitiveType()

public abstract long getTotalSize();

public abstract Statistics getStatistics();
public abstract Statistics<?> getStatistics();

public IndexReference getColumnIndexReference()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ class IntColumnChunkMetadata
private final int valueCount;
private final int totalSize;
private final int totalUncompressedSize;
private final Statistics statistics;
private final Statistics<?> statistics;

IntColumnChunkMetadata(
ColumnPath path,
PrimitiveType type,
CompressionCodecName codec,
EncodingStats encodingStats,
Set<Encoding> encodings,
Statistics statistics,
Statistics<?> statistics,
long firstDataPage,
long dictionaryPageOffset,
long valueCount,
Expand Down Expand Up @@ -98,7 +98,7 @@ public long getTotalSize()
}

@Override
public Statistics getStatistics()
public Statistics<?> getStatistics()
{
return statistics;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ class LongColumnChunkMetadata
private final long valueCount;
private final long totalSize;
private final long totalUncompressedSize;
private final Statistics statistics;
private final Statistics<?> statistics;

LongColumnChunkMetadata(
ColumnPath path,
PrimitiveType type,
CompressionCodecName codec,
EncodingStats encodingStats,
Set<Encoding> encodings,
Statistics statistics,
Statistics<?> statistics,
long firstDataPageOffset,
long dictionaryPageOffset,
long valueCount,
Expand Down Expand Up @@ -85,7 +85,7 @@ public long getTotalSize()
}

@Override
public Statistics getStatistics()
public Statistics<?> getStatistics()
{
return statistics;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ValuesWriter newValuesWriter(ColumnDescriptor descriptor, Optional<BloomF
private ValuesWriter getFixedLenByteArrayValuesWriter(ColumnDescriptor path, Optional<BloomFilter> bloomFilter)
{
// dictionary encoding was not enabled in PARQUET 1.0
return createBloomFilterValuesWriter(new FixedLenByteArrayPlainValuesWriter(path.getTypeLength(), parquetProperties.getInitialSlabSize(), parquetProperties.getPageSizeThreshold(), parquetProperties.getAllocator()), bloomFilter);
return createBloomFilterValuesWriter(new FixedLenByteArrayPlainValuesWriter(path.getPrimitiveType().getTypeLength(), parquetProperties.getInitialSlabSize(), parquetProperties.getPageSizeThreshold(), parquetProperties.getAllocator()), bloomFilter);
}

private ValuesWriter getBinaryValuesWriter(ColumnDescriptor path, Optional<BloomFilter> bloomFilter)
Expand Down Expand Up @@ -125,7 +125,7 @@ private static DictionaryValuesWriter dictionaryWriter(ColumnDescriptor path, Pa
case FLOAT ->
new DictionaryValuesWriter.PlainFloatDictionaryValuesWriter(properties.getDictionaryPageSizeThreshold(), dataPageEncoding, dictPageEncoding, properties.getAllocator());
case FIXED_LEN_BYTE_ARRAY ->
new DictionaryValuesWriter.PlainFixedLenArrayDictionaryValuesWriter(properties.getDictionaryPageSizeThreshold(), path.getTypeLength(), dataPageEncoding, dictPageEncoding, properties.getAllocator());
new DictionaryValuesWriter.PlainFixedLenArrayDictionaryValuesWriter(properties.getDictionaryPageSizeThreshold(), path.getPrimitiveType().getTypeLength(), dataPageEncoding, dictPageEncoding, properties.getAllocator());
};
}

Expand Down

0 comments on commit af0ccdd

Please sign in to comment.