[fix](inverted index) check all pushdown for match predicate (#22836)

This commit is contained in:
airborne12
2023-08-11 09:02:15 +08:00
committed by GitHub
parent 0aa00026bb
commit be5d11e0ec
2 changed files with 8 additions and 5 deletions

View File

@ -768,7 +768,8 @@ Status SegmentIterator::_apply_index_except_leafnode_of_andnode() {
for (auto pred : _col_preds_except_leafnode_of_andnode) {
auto column_name = _schema->column(pred->column_id())->name();
if (!_remaining_conjunct_roots.empty() &&
_check_column_pred_all_push_down(column_name, true) &&
_check_column_pred_all_push_down(column_name, true,
pred->type() == PredicateType::MATCH) &&
!pred->predicate_params()->marked_by_runtime_filter) {
int32_t unique_id = _schema->unique_id(pred->column_id());
_need_read_data_indices[unique_id] = false;
@ -887,7 +888,8 @@ Status SegmentIterator::_apply_inverted_index_on_column_predicate(
}
auto column_name = _schema->column(pred->column_id())->name();
if (_check_column_pred_all_push_down(column_name) &&
if (_check_column_pred_all_push_down(column_name, false,
pred->type() == PredicateType::MATCH) &&
!pred->predicate_params()->marked_by_runtime_filter) {
_need_read_data_indices[unique_id] = false;
}
@ -2164,12 +2166,12 @@ Status SegmentIterator::current_block_row_locations(std::vector<RowLocation>* bl
* call _check_column_pred_all_push_down will return false.
*/
bool SegmentIterator::_check_column_pred_all_push_down(const std::string& column_name,
bool in_compound) {
bool in_compound, bool is_match) {
if (_remaining_conjunct_roots.empty()) {
return true;
}
if (in_compound) {
if (in_compound || is_match) {
auto preds_in_remaining_vconjuct = _column_pred_in_remaining_vconjunct[column_name];
for (auto pred_info : preds_in_remaining_vconjuct) {
auto column_sign = _gen_predicate_result_sign(&pred_info);

View File

@ -269,7 +269,8 @@ private:
size_t num_of_defaults);
// return true means one column's predicates all pushed down
bool _check_column_pred_all_push_down(const std::string& column_name, bool in_compound = false);
bool _check_column_pred_all_push_down(const std::string& column_name, bool in_compound = false,
bool is_match = false);
void _calculate_pred_in_remaining_conjunct_root(const vectorized::VExprSPtr& expr);
// todo(wb) remove this method after RowCursor is removed