Skip to content

Commit

Permalink
[branch-2.1](ORC) fix predicate filter failed when use hive 1.x versi…
Browse files Browse the repository at this point in the history
…on (#45809)

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #43185 

Pick the pr to branch-2.1 to fix predicate filter failed when use hive
1.x version

Co-authored-by: fantasy12345zsq <[email protected]>
  • Loading branch information
suxiaogang223 and fantasy12345zsq authored Dec 25, 2024
1 parent a3ec862 commit c94ac6c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions be/src/vec/exec/format/orc/vorc_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,19 @@ bool OrcReader::_init_search_argument(
if (predicates.empty()) {
return false;
}

if (_is_hive1_orc_or_use_idx) {
// use hive 1.x version orc file, need to convert column name to internal column name
for (OrcPredicate& it : predicates) {
it.col_name = _col_name_to_file_col_name[it.col_name];
}
}

// check if all column names in predicates are same as orc file
DCHECK(std::all_of(predicates.begin(), predicates.end(), [&](const OrcPredicate& predicate) {
return type_map.contains(predicate.col_name);
}));

std::unique_ptr<orc::SearchArgumentBuilder> builder = orc::SearchArgumentFactory::newBuilder();
if (build_search_argument(predicates, 0, builder)) {
std::unique_ptr<orc::SearchArgument> sargs = builder->build();
Expand Down

0 comments on commit c94ac6c

Please sign in to comment.