Skip to content

Commit

Permalink
finish tmp
Browse files Browse the repository at this point in the history
Signed-off-by: Smith Cruise <chendingchao1@126.com>
  • Loading branch information
Smith-Cruise committed Nov 28, 2024
1 parent a691e19 commit 7aed953
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions be/src/formats/parquet/complex_column_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,30 +410,31 @@ StatusOr<bool> StructColumnReader::page_index_zone_map_filter(const std::vector<
return ret.value();
};

bool has_filtered = false;

std::vector<const ColumnPredicate*> rewritten_predicates;
RETURN_IF_ERROR(_rewrite_column_expr_predicate(&pool, predicates, rewritten_predicates));

std::optional<SparseRange<uint64_t>> result_sparse_range = std::nullopt;

for (const ColumnPredicate* predicate : rewritten_predicates) {
SparseRange<uint64_t> cur_row_ranges;
if (handle_page_index(predicate, &cur_row_ranges)) {
has_filtered = true;
if (pred_relation == CompoundNodeType::AND) {
merge_row_ranges<CompoundNodeType::AND>(result_sparse_range, cur_row_ranges);
} else {
merge_row_ranges<CompoundNodeType::OR>(result_sparse_range, cur_row_ranges);
}
SparseRange<uint64_t> tmp_row_ranges;

if (!handle_page_index(predicate, &tmp_row_ranges)) {
// select all
tmp_row_ranges.add({rg_first_row, rg_first_row + rg_num_rows});
}
}

if (has_filtered) {
*row_ranges = std::move(result_sparse_range.value());
if (pred_relation == CompoundNodeType::AND) {
merge_row_ranges<CompoundNodeType::AND>(result_sparse_range, tmp_row_ranges);
} else {
merge_row_ranges<CompoundNodeType::OR>(result_sparse_range, tmp_row_ranges);
}
}

return has_filtered;
if (!result_sparse_range.has_value()) {
return false;
}
*row_ranges = std::move(result_sparse_range.value());
return row_ranges->span_size() < rg_num_rows;
}

StatusOr<ColumnPredicate*> StructColumnReader::_try_to_rewrite_subfield_expr(
Expand Down

0 comments on commit 7aed953

Please sign in to comment.