Skip to content

Commit 76935a0

Browse files
committed
[fix](be) Construct storage read options in index tests
### What problem does this PR solve? Issue Number: None Related PR: #69070 Problem Summary: The latest master deletes the default StorageReadOptions constructor. Rebased BUILD INDEX tests still used that constructor to obtain block_row_max, which prevented the BE unit-test target from compiling. Construct the options with a statistics sink before reading the batch limit. ### Release note None ### Check List (For Author) - Test: BE compilation passed; BE unit-test compilation is being rerun with -j 128 - Behavior changed: No - Does this need documentation: No
1 parent 0c2d3b1 commit 76935a0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎be/test/storage/index/index_builder_test.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ class IndexBuilderTest : public ::testing::Test {
421421
// More [] rows than one BUILD INDEX read batch (block_row_max) holds, so the builder's
422422
// first block is all [].
423423
static int32_t empty_rows_before_items() {
424-
return static_cast<int32_t>(StorageReadOptions().block_row_max) + 32;
424+
OlapReaderStatistics stats;
425+
const StorageReadOptions options(stats);
426+
return static_cast<int32_t>(options.block_row_max) + 32;
425427
}
426428

427429
// A tablet whose NOT NULL ARRAY<VARCHAR> column `tags` (unique id 2) holds
@@ -4358,7 +4360,9 @@ TEST_F(IndexBuilderTest, BuildAnnIndexRejectsAllEmptyBlock) {
43584360
auto rowset_writer = std::move(res).value();
43594361

43604362
// No vector shares a read batch with a [] row, so only the all-[] batch can fail the build.
4361-
const auto empty_rows = static_cast<int32_t>(StorageReadOptions().block_row_max);
4363+
OlapReaderStatistics stats;
4364+
const StorageReadOptions options(stats);
4365+
const auto empty_rows = static_cast<int32_t>(options.block_row_max);
43624366
Block block = tablet_schema->create_storage_block();
43634367
auto columns = std::move(block).mutate_columns();
43644368
for (int32_t i = 0; i < empty_rows; ++i) {

0 commit comments

Comments
 (0)