Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions parquet-hadoop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@
<artifactId>commons-pool</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>${fastutil.version}</version>
</dependency>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static org.apache.parquet.hadoop.ParquetFileReaderMetrics.PagesIncluded;
import static org.apache.parquet.hadoop.ParquetFileReaderMetrics.PagesSkipped;

import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Formatter;
Expand Down Expand Up @@ -137,14 +135,13 @@ static OffsetIndex filterOffsetIndex(
RowRanges rowRanges,
long totalRowCount,
org.apache.parquet.ParquetReadOptions options) {
IntList indexMap = new IntArrayList();
int[] indexMap = new int[offsetIndex.getPageCount()];
int pagesIncluded = 0;
int pagesSkipped = 0;
for (int i = 0, n = offsetIndex.getPageCount(); i < n; ++i) {
long from = offsetIndex.getFirstRowIndex(i);
if (rowRanges.isOverlapping(from, offsetIndex.getLastRowIndex(i, totalRowCount))) {
indexMap.add(i);
pagesIncluded++;
indexMap[pagesIncluded++] = i;
} else {
pagesSkipped++;
}
Expand All @@ -156,7 +153,7 @@ static OffsetIndex filterOffsetIndex(
metricsCallback.setValueInt(PagesSkipped.name(), pagesSkipped);
}

return new FilteredOffsetIndex(offsetIndex, indexMap.toIntArray());
return new FilteredOffsetIndex(offsetIndex, Arrays.copyOf(indexMap, pagesIncluded));
}

static List<OffsetRange> calculateOffsetRanges(
Expand Down
9 changes: 0 additions & 9 deletions parquet-hadoop/src/main/resources/META-INF/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,3 @@ Copyright: 2012-2014 Twitter
Home page: https://github.com/twitter/elephant-bird
License: Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)

--------------------------------------------------------------------------------

This product bundles fastutil in this binary artifact. fastutil provides
type-specific collection implementations.

Copyright: 2002-2024 Sebastiano Vigna
Home page: https://fastutil.di.unimi.it/
License: Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import it.unimi.dsi.fastutil.longs.LongArrayList;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand Down Expand Up @@ -1642,18 +1641,18 @@ public void testColumnIndexConversion() {
stats.updateStats(100l);
builder.add(
stats,
withSizeStats ? new SizeStatistics(type, 0, LongArrayList.of(1, 2), LongArrayList.of(6, 5)) : null);
withSizeStats ? new SizeStatistics(type, 0, Arrays.asList(1L, 2L), Arrays.asList(6L, 5L)) : null);
stats = Statistics.createStats(type);
stats.incrementNumNulls(111);
builder.add(
stats,
withSizeStats ? new SizeStatistics(type, 0, LongArrayList.of(3, 4), LongArrayList.of(4, 3)) : null);
withSizeStats ? new SizeStatistics(type, 0, Arrays.asList(3L, 4L), Arrays.asList(4L, 3L)) : null);
stats = Statistics.createStats(type);
stats.updateStats(200l);
stats.updateStats(500l);
builder.add(
stats,
withSizeStats ? new SizeStatistics(type, 0, LongArrayList.of(5, 6), LongArrayList.of(2, 1)) : null);
withSizeStats ? new SizeStatistics(type, 0, Arrays.asList(5L, 6L), Arrays.asList(2L, 1L)) : null);
org.apache.parquet.format.ColumnIndex parquetColumnIndex =
ParquetMetadataConverter.toParquetColumnIndex(type, builder.build());
ColumnIndex columnIndex = ParquetMetadataConverter.fromParquetColumnIndex(type, parquetColumnIndex);
Expand Down