wangbo commented on a change in pull request #8627:
URL: https://github.com/apache/incubator-doris/pull/8627#discussion_r834945195
##########
File path: be/src/olap/rowset/segment_v2/segment_iterator.cpp
##########
@@ -830,23 +831,17 @@ void
SegmentIterator::_evaluate_short_circuit_predicate(uint16_t* vec_sel_rowid_
return;
}
- for (auto column_predicate : _short_cir_eval_predicate) {
- auto column_id = column_predicate->column_id();
+ for (auto predicate : _short_cir_eval_predicate) {
+ auto column_id = predicate->column_id();
auto& short_cir_column = _current_return_columns[column_id];
auto* col_ptr = short_cir_column.get();
- // todo(zeno) define convert_dict_codes_if_dictionary interface in
IColumn
- if (short_cir_column->is_nullable()) {
- auto nullable_col =
-
reinterpret_cast<vectorized::ColumnNullable*>(short_cir_column.get());
- col_ptr = nullable_col->get_nested_column_ptr().get();
+ // range comparison predicate needs to sort the dict and convert the
encoding
+ if (predicate->type() == PredicateType::LT || predicate->type() ==
PredicateType::LE ||
+ predicate->type() == PredicateType::GT || predicate->type() ==
PredicateType::GE) {
+ col_ptr->convert_dict_codes_if_necessary();
}
-
- if (col_ptr->is_column_dictionary() &&
column_predicate->is_range_comparison_predicate()) {
- auto& dict_col =
-
reinterpret_cast<vectorized::ColumnDictionary<vectorized::Int32>&>(*col_ptr);
- dict_col.convert_dict_codes();
- }
- column_predicate->evaluate(*short_cir_column, vec_sel_rowid_idx,
selected_size_ptr);
+ col_ptr->set_predicate_dict_code_if_necessary(predicate);
Review comment:
First, It seems that you do ```set_predicate_dict_code_if_necessary```
after read one block.
Maybe we can do ```set_predicate_dict_code_if_necessary``` in SegmentIter's
init method.
Because I think dict is immutable after segment is loaded, and the same to
Predicate.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]