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
1 change: 1 addition & 0 deletions be/src/format/reader/column_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ Status TableColumnMapper::localize_filters(const std::vector<TableFilter>& table
file_request->conjuncts.push_back(
VExprContext::create_shared(rewrite_table_expr_to_file_expr(
table_filter.conjunct->root(), table_column_to_file_slot)));
table_filter.conjunct->clone_fn_contexts(file_request->conjuncts.back().get());
}
}
for (const auto& [table_column_id, predicates] : table_column_predicates) {
Expand Down
22 changes: 9 additions & 13 deletions be/src/format/reader/table_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,21 @@ void collect_table_slot_ids(const VExprSPtr& expr, std::set<int>* slot_ids) {
}
}

void build_table_filters_from_conjunct(const VExprSPtr& conjunct,
std::vector<TableFilter>* table_filters) {
Status build_table_filters_from_conjunct(const VExprContextSPtr& conjunct, RuntimeState* state,
std::vector<TableFilter>* table_filters) {
if (conjunct == nullptr) {
return;
}
if (conjunct->node_type() == TExprNodeType::COMPOUND_PRED &&
conjunct->op() == TExprOpcode::COMPOUND_AND) {
for (const auto& child : conjunct->children()) {
build_table_filters_from_conjunct(child, table_filters);
}
return;
return Status::OK();
}
std::set<int> slot_ids;
collect_table_slot_ids(conjunct, &slot_ids);
collect_table_slot_ids(conjunct->root(), &slot_ids);
if (!slot_ids.empty()) {
TableFilter table_filter;
table_filter.conjunct = VExprContext::create_shared(conjunct);
table_filter.conjunct = nullptr;
RETURN_IF_ERROR(conjunct->clone(state, table_filter.conjunct));
table_filter.slot_ids.assign(slot_ids.begin(), slot_ids.end());
table_filters->push_back(std::move(table_filter));
}
return Status::OK();
}

Status parse_deletion_vector(const char* buf, size_t buffer_size, DeleteFileDesc::Format format,
Expand Down Expand Up @@ -169,7 +164,8 @@ Status TableReader::init(TableReadOptions&& options) {
Status TableReader::_build_table_filters_from_conjuncts() {
_table_filters.clear();
for (const auto& conjunct : _conjuncts) {
build_table_filters_from_conjunct(conjunct->root(), &_table_filters);
RETURN_IF_ERROR(
build_table_filters_from_conjunct(conjunct, _runtime_state, &_table_filters));
}
return Status::OK();
}
Expand Down
Loading