github-actions[bot] commented on code in PR #24638: URL: https://github.com/apache/doris/pull/24638#discussion_r1331437062
########## be/test/olap/rowid_conversion_test.cpp: ########## @@ -329,26 +312,37 @@ class TestRowIdConversion : public testing::TestWithParam<std::tuple<KeysType, b new_overlap = OVERLAPPING; } } - RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i]); + RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i], i); input_rowsets.push_back(rowset); } + // delete data with key < 1000 + std::vector<TCondition> conditions; Review Comment: warning: variable 'conditions' is not initialized [cppcoreguidelines-init-variables] ```suggestion std::vector<TCondition> conditions = 0; ``` ########## be/test/olap/rowid_conversion_test.cpp: ########## @@ -329,26 +312,37 @@ class TestRowIdConversion : public testing::TestWithParam<std::tuple<KeysType, b new_overlap = OVERLAPPING; } } - RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i]); + RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i], i); input_rowsets.push_back(rowset); } + // delete data with key < 1000 + std::vector<TCondition> conditions; + TCondition condition; + condition.column_name = tablet_schema->column(0).name(); + condition.condition_op = "<"; + condition.condition_values.clear(); + condition.condition_values.push_back("1000"); + conditions.push_back(condition); + + DeletePredicatePB del_pred; + Status st = DeleteHandler::generate_delete_predicate(*tablet_schema, conditions, &del_pred); Review Comment: warning: variable 'st' is not initialized [cppcoreguidelines-init-variables] ```suggestion Status st = 0 = DeleteHandler::generate_delete_predicate(*tablet_schema, conditions, &del_pred); ``` ########## be/test/olap/rowid_conversion_test.cpp: ########## @@ -329,26 +312,37 @@ class TestRowIdConversion : public testing::TestWithParam<std::tuple<KeysType, b new_overlap = OVERLAPPING; } } - RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i]); + RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i], i); Review Comment: warning: variable 'rowset' is not initialized [cppcoreguidelines-init-variables] ```suggestion RowsetSharedPtr rowset = 0 = create_rowset(tablet_schema, new_overlap, input_data[i], i); ``` ########## be/test/olap/rowid_conversion_test.cpp: ########## @@ -139,22 +139,24 @@ class TestRowIdConversion : public testing::TestWithParam<std::tuple<KeysType, b return tablet_schema; } - void create_rowset_writer_context(TabletSchemaSPtr tablet_schema, - const SegmentsOverlapPB& overlap, - uint32_t max_rows_per_segment, - RowsetWriterContext* rowset_writer_context) { - static int64_t inc_id = 0; + RowsetWriterContext create_rowset_writer_context(TabletSchemaSPtr tablet_schema, + const SegmentsOverlapPB& overlap, + uint32_t max_rows_per_segment, + Version version) { + static int64_t inc_id = 1000; + RowsetWriterContext rowset_writer_context; Review Comment: warning: variable 'rowset_writer_context' is not initialized [cppcoreguidelines-init-variables] ```suggestion RowsetWriterContext rowset_writer_context = 0; ``` ########## be/test/olap/rowid_conversion_test.cpp: ########## @@ -329,26 +312,37 @@ class TestRowIdConversion : public testing::TestWithParam<std::tuple<KeysType, b new_overlap = OVERLAPPING; } } - RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i]); + RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i], i); input_rowsets.push_back(rowset); } + // delete data with key < 1000 + std::vector<TCondition> conditions; + TCondition condition; Review Comment: warning: variable 'condition' is not initialized [cppcoreguidelines-init-variables] ```suggestion TCondition condition = 0; ``` ########## be/test/olap/rowid_conversion_test.cpp: ########## @@ -329,26 +312,37 @@ class TestRowIdConversion : public testing::TestWithParam<std::tuple<KeysType, b new_overlap = OVERLAPPING; } } - RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i]); + RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i], i); input_rowsets.push_back(rowset); } + // delete data with key < 1000 + std::vector<TCondition> conditions; + TCondition condition; + condition.column_name = tablet_schema->column(0).name(); + condition.condition_op = "<"; + condition.condition_values.clear(); + condition.condition_values.push_back("1000"); + conditions.push_back(condition); + + DeletePredicatePB del_pred; Review Comment: warning: variable 'del_pred' is not initialized [cppcoreguidelines-init-variables] ```suggestion DeletePredicatePB del_pred = 0; ``` ########## be/test/olap/rowid_conversion_test.cpp: ########## @@ -329,26 +312,37 @@ class TestRowIdConversion : public testing::TestWithParam<std::tuple<KeysType, b new_overlap = OVERLAPPING; } } - RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i]); + RowsetSharedPtr rowset = create_rowset(tablet_schema, new_overlap, input_data[i], i); input_rowsets.push_back(rowset); } + // delete data with key < 1000 + std::vector<TCondition> conditions; + TCondition condition; + condition.column_name = tablet_schema->column(0).name(); + condition.condition_op = "<"; + condition.condition_values.clear(); + condition.condition_values.push_back("1000"); + conditions.push_back(condition); + + DeletePredicatePB del_pred; + Status st = DeleteHandler::generate_delete_predicate(*tablet_schema, conditions, &del_pred); + ASSERT_TRUE(st.ok()) << st; + input_rowsets.push_back(create_delete_predicate(tablet_schema, del_pred, num_input_rowset)); // create output rowset writer - RowsetWriterContext writer_context; - create_rowset_writer_context(tablet_schema, NONOVERLAPPING, 3456, &writer_context); + auto writer_context = create_rowset_writer_context( + tablet_schema, NONOVERLAPPING, 3456, {0, input_rowsets.back()->end_version()}); std::unique_ptr<RowsetWriter> output_rs_writer; Status s; if (is_vertical_merger) { s = RowsetFactory::create_rowset_writer(writer_context, true, &output_rs_writer); } else { s = RowsetFactory::create_rowset_writer(writer_context, false, &output_rs_writer); } - EXPECT_TRUE(s.ok()); + ASSERT_TRUE(s.ok()) << s; // merge input rowset - TabletSharedPtr tablet = - create_tablet(*tablet_schema, enable_unique_key_merge_on_write, - output_rs_writer->version().first - 1, has_delete_handler); + TabletSharedPtr tablet = create_tablet(*tablet_schema, enable_unique_key_merge_on_write); Review Comment: warning: variable 'tablet' is not initialized [cppcoreguidelines-init-variables] ```suggestion TabletSharedPtr tablet = 0 = create_tablet(*tablet_schema, enable_unique_key_merge_on_write); ``` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org