Skip to content

Commit 56eb95a

Browse files
committed
fix ut compile
1 parent 9ae69b4 commit 56eb95a

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

be/test/vec/exprs/vexpr_evalute_inverted_index_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,18 @@ TEST(TExprInvertedIndexTest, test_expr_evaluate_inverted_index) {
158158

159159
std::unordered_map<doris::ColumnId, std::unordered_map<const doris::vectorized::VExpr*, bool>>
160160
common_expr_inverted_index_status;
161-
auto inverted_index_context = std::make_shared<doris::vectorized::InvertedIndexContext>(
161+
auto inverted_index_context = std::make_shared<doris::vectorized::IndexExecContext>(
162162
std::vector<doris::ColumnId>(),
163163
std::vector<std::unique_ptr<doris::segment_v2::IndexIterator>>(),
164164
std::vector<doris::vectorized::IndexFieldNameAndTypePair>(),
165165
common_expr_inverted_index_status, nullptr);
166-
expr_ctx.set_inverted_index_context(inverted_index_context);
166+
expr_ctx.set_index_context(inverted_index_context);
167167
doris::RuntimeState state;
168168
doris::RowDescriptor row_desc;
169169
EXPECT_TRUE(in_expr->prepare(&state, row_desc, &expr_ctx).ok());
170170
EXPECT_TRUE(in_expr->evaluate_inverted_index(&expr_ctx, 100).ok());
171-
EXPECT_FALSE(expr_ctx.get_inverted_index_context()->has_inverted_index_result_for_expr(
171+
EXPECT_FALSE(expr_ctx.get_index_context()->has_index_result_for_expr(
172172
in_expr.get()));
173-
EXPECT_TRUE(expr_ctx.get_inverted_index_context()->_inverted_index_result_bitmap.empty());
174-
EXPECT_TRUE(expr_ctx.get_inverted_index_context()->_expr_inverted_index_status.empty());
173+
EXPECT_TRUE(expr_ctx.get_index_context()->_index_result_bitmap.empty());
174+
EXPECT_TRUE(expr_ctx.get_index_context()->_expr_index_status.empty());
175175
}

be/test/vec/exprs/vsearch_expr_test.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ VExprSPtr create_slot_ref(int column_id, const std::string& column_name) {
9292
return slot;
9393
}
9494

95-
std::shared_ptr<InvertedIndexContext> make_inverted_context(
95+
std::shared_ptr<IndexExecContext> make_inverted_context(
9696
std::vector<ColumnId>& col_ids,
9797
std::vector<std::unique_ptr<segment_v2::IndexIterator>>& index_iterators,
9898
std::vector<IndexFieldNameAndTypePair>& storage_types,
9999
std::unordered_map<ColumnId, std::unordered_map<const VExpr*, bool>>& status_map) {
100-
return std::make_shared<InvertedIndexContext>(col_ids, index_iterators, storage_types,
100+
return std::make_shared<IndexExecContext>(col_ids, index_iterators, storage_types,
101101
status_map, nullptr);
102102
}
103103

@@ -1068,8 +1068,8 @@ TEST_F(VSearchExprTest, TestCollectSearchInputsWithUnsupportedChildType) {
10681068
VExprContext context(dummy_expr);
10691069

10701070
// This should trigger the collect_search_inputs function, but since we don't have
1071-
// a real InvertedIndexContext, it will return early with Status::OK
1072-
// If we had a real InvertedIndexContext, it would reach the unsupported child type error
1071+
// a real IndexExecContext, it will return early with Status::OK
1072+
// If we had a real IndexExecContext, it would reach the unsupported child type error
10731073
auto status = vsearch_expr->evaluate_inverted_index(&context, 100);
10741074
EXPECT_TRUE(status.ok()); // Early return due to nullptr index_context
10751075
}
@@ -1145,7 +1145,7 @@ TEST_F(VSearchExprTest, TestEvaluateInvertedIndexWithEmptyIterators) {
11451145
// This covers lines 138-141 in evaluate_inverted_index
11461146
auto vsearch_expr = VSearchExpr::create_shared(test_node);
11471147

1148-
// Create a mock InvertedIndexContext that returns empty iterators
1148+
// Create a mock IndexExecContext that returns empty iterators
11491149
// For now, we test the early return path when index_context is nullptr
11501150
auto dummy_expr = VSearchExpr::create_shared(test_node);
11511151
VExprContext context(dummy_expr);
@@ -1301,8 +1301,8 @@ TEST_F(VSearchExprTest, FastExecuteReturnsPrecomputedColumn) {
13011301

13021302
auto inverted_ctx = make_inverted_context(col_ids, index_iterators, storage_types, status_map);
13031303
MutableColumnPtr result_column = ColumnUInt8::create();
1304-
inverted_ctx->set_inverted_index_result_column_for_expr(expr.get(), std::move(result_column));
1305-
context->set_inverted_index_context(inverted_ctx);
1304+
inverted_ctx->set_index_result_column_for_expr(expr.get(), std::move(result_column));
1305+
context->set_index_context(inverted_ctx);
13061306

13071307
Block block;
13081308
int result_column_id = -1;
@@ -1325,7 +1325,7 @@ TEST_F(VSearchExprTest, EvaluateInvertedIndexFailsWithoutStorageType) {
13251325

13261326
auto inverted_ctx = make_inverted_context(col_ids, index_iterators, storage_types, status_map);
13271327
auto context = std::make_shared<VExprContext>(expr);
1328-
context->set_inverted_index_context(inverted_ctx);
1328+
context->set_index_context(inverted_ctx);
13291329

13301330
auto status = expr->evaluate_inverted_index(context.get(), 128);
13311331
EXPECT_FALSE(status.ok());
@@ -1343,7 +1343,7 @@ TEST_F(VSearchExprTest, EvaluateInvertedIndexWithUnsupportedChildReturnsError) {
13431343

13441344
auto inverted_ctx = make_inverted_context(col_ids, index_iterators, storage_types, status_map);
13451345
auto context = std::make_shared<VExprContext>(expr);
1346-
context->set_inverted_index_context(inverted_ctx);
1346+
context->set_index_context(inverted_ctx);
13471347

13481348
auto status = expr->evaluate_inverted_index(context.get(), 64);
13491349
EXPECT_FALSE(status.ok());
@@ -1363,7 +1363,7 @@ TEST_F(VSearchExprTest, EvaluateInvertedIndexHandlesMissingIterators) {
13631363

13641364
auto inverted_ctx = make_inverted_context(col_ids, index_iterators, storage_types, status_map);
13651365
auto context = std::make_shared<VExprContext>(expr);
1366-
context->set_inverted_index_context(inverted_ctx);
1366+
context->set_index_context(inverted_ctx);
13671367

13681368
auto status = expr->evaluate_inverted_index(context.get(), 32);
13691369
EXPECT_TRUE(status.ok());
@@ -1384,15 +1384,15 @@ TEST_F(VSearchExprTest, EvaluateInvertedIndexPropagatesFunctionFailure) {
13841384

13851385
auto inverted_ctx = make_inverted_context(col_ids, index_iterators, storage_types, status_map);
13861386
auto context = std::make_shared<VExprContext>(expr);
1387-
context->set_inverted_index_context(inverted_ctx);
1387+
context->set_index_context(inverted_ctx);
13881388

13891389
auto status = expr->evaluate_inverted_index(context.get(), 256);
13901390
EXPECT_FALSE(status.ok());
13911391
EXPECT_EQ(ErrorCode::INVERTED_INDEX_FILE_NOT_FOUND, status.code());
13921392
EXPECT_FALSE(status_map[0][expr.get()]);
13931393
}
13941394

1395-
// Note: Full testing with actual InvertedIndexContext and real iterators
1395+
// Note: Full testing with actual IndexExecContext and real iterators
13961396
// would require complex setup and is better suited for integration tests
13971397
// The tests above cover the main execution paths in evaluate_inverted_index
13981398

0 commit comments

Comments
 (0)