Skip to content

Commit 74b5e69

Browse files
committed
Revert "[fix](inverted index) fix wrong read data for primary key (#47841)"
This reverts commit e4af142.
1 parent ec31ac2 commit 74b5e69

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

be/src/olap/rowset/segment_v2/segment_iterator.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,19 +2895,7 @@ bool SegmentIterator::_no_need_read_key_data(ColumnId cid, vectorized::MutableCo
28952895
return false;
28962896
}
28972897

2898-
// seek_schema is set when get_row_ranges_by_keys, it is null when there is no primary key range
2899-
// in this case, we need to read data
2900-
if (!_seek_schema) {
2901-
return false;
2902-
}
2903-
// check if the column is in the seek_schema
2904-
if (std::none_of(_seek_schema->columns().begin(), _seek_schema->columns().end(),
2905-
[&](const Field* col) {
2906-
return (col && _opts.tablet_schema->field_index(col->unique_id()) == cid);
2907-
})) {
2908-
return false;
2909-
}
2910-
if (!_check_all_conditions_passed_inverted_index_for_column(cid, true)) {
2898+
if (!_check_all_conditions_passed_inverted_index_for_column(cid)) {
29112899
return false;
29122900
}
29132901

regression-test/suites/inverted_index_p0/test_pk_no_need_read_data.groovy

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
suite("test_pk_no_need_read_data", "nonConcurrent"){
17+
suite("test_pk_no_need_read_data", "p0"){
1818
def table1 = "test_pk_no_need_read_data"
1919

2020
sql "drop table if exists ${table1}"
@@ -56,15 +56,12 @@ suite("test_pk_no_need_read_data", "nonConcurrent"){
5656
sql "set enable_count_on_index_pushdown = true"
5757
sql """ set enable_common_expr_pushdown = true """
5858

59-
try {
60-
GetDebugPoint().enableDebugPointForAllBEs("segment_iterator._read_columns_by_index")
61-
qt_select_0 "SELECT COUNT() FROM ${table1} WHERE date='2017-10-01'"
62-
} finally {
63-
GetDebugPoint().disableDebugPointForAllBEs("segment_iterator._read_columns_by_index")
64-
}
59+
qt_select_0 "SELECT COUNT() FROM ${table1} WHERE date='2017-10-01'"
6560
qt_select_1 "SELECT COUNT() FROM ${table1} WHERE year(date)='2017'"
66-
// case2: disable count on index
61+
62+
// case1: disable count on index
6763
sql "set enable_count_on_index_pushdown = false"
64+
6865
qt_select_2 "SELECT COUNT() FROM ${table1} WHERE date='2017-10-01'"
6966
qt_select_3 "SELECT COUNT() FROM ${table1} WHERE year(date)='2017'"
7067
}

0 commit comments

Comments
 (0)