Skip to content

Commit

Permalink
PARQUET-1964: FOLLOWUP: Avoid constructing useless ArrayList (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyum authored Feb 3, 2021
1 parent 27448d8 commit e6bca6f
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -851,23 +851,22 @@ public String getFile() {
}

private List<BlockMetaData> filterRowGroups(List<BlockMetaData> blocks) throws IOException {
// set up data filters based on configured levels
List<RowGroupFilter.FilterLevel> levels = new ArrayList<>();

if (options.useStatsFilter()) {
levels.add(STATISTICS);
}
FilterCompat.Filter recordFilter = options.getRecordFilter();
if (FilterCompat.isFilteringRequired(recordFilter)) {
// set up data filters based on configured levels
List<RowGroupFilter.FilterLevel> levels = new ArrayList<>();

if (options.useDictionaryFilter()) {
levels.add(DICTIONARY);
}
if (options.useStatsFilter()) {
levels.add(STATISTICS);
}

if (options.useBloomFilter()) {
levels.add(BLOOMFILTER);
}
if (options.useDictionaryFilter()) {
levels.add(DICTIONARY);
}

FilterCompat.Filter recordFilter = options.getRecordFilter();
if (FilterCompat.isFilteringRequired(recordFilter)) {
if (options.useBloomFilter()) {
levels.add(BLOOMFILTER);
}
return RowGroupFilter.filterRowGroups(levels, recordFilter, blocks, this);
}

Expand Down

0 comments on commit e6bca6f

Please sign in to comment.