MCPcopy Create free account
hub / github.com/apache/kvrocks / TEST_F

Function TEST_F

tests/cppunit/plan_executor_test.cc:311–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309};
310
311TEST_F(PlanExecutorTestC, FullIndexScan) {
312 json_->Set(*ctx_, "test1:a", "$", "{}");
313 json_->Set(*ctx_, "test1:b", "$", "{}");
314 json_->Set(*ctx_, "test2:c", "$", "{\"f3\": 6}");
315 json_->Set(*ctx_, "test3:d", "$", "{}");
316 json_->Set(*ctx_, "test4:e", "$", "{\"f3\": 7}");
317 json_->Set(*ctx_, "test4:f", "$", "{\"f3\": 2}");
318 json_->Set(*ctx_, "test4:g", "$", "{\"f3\": 8}");
319 json_->Set(*ctx_, "test5:h", "$", "{}");
320 json_->Set(*ctx_, "test5:i", "$", "{}");
321 json_->Set(*ctx_, "test5:g", "$", "{}");
322
323 {
324 auto op = std::make_unique<FullIndexScan>(std::make_unique<IndexRef>("ia", IndexI()));
325
326 auto ctx = ExecutorContext(op.get(), storage_.get());
327 ASSERT_EQ(NextRow(ctx).key, "test2:c");
328 ASSERT_EQ(NextRow(ctx).key, "test4:e");
329 ASSERT_EQ(NextRow(ctx).key, "test4:f");
330 ASSERT_EQ(NextRow(ctx).key, "test4:g");
331 ASSERT_EQ(ctx.Next().GetValue(), exe_end);
332 }
333
334 {
335 auto op = std::make_unique<Filter>(
336 std::make_unique<FullIndexScan>(std::make_unique<IndexRef>("ia", IndexI())),
337 std::make_unique<NumericCompareExpr>(NumericCompareExpr::GT, std::make_unique<FieldRef>("f3", FieldI("f3")),
338 std::make_unique<NumericLiteral>(3)));
339
340 auto ctx = ExecutorContext(op.get(), storage_.get());
341 ASSERT_EQ(NextRow(ctx).key, "test2:c");
342 ASSERT_EQ(NextRow(ctx).key, "test4:e");
343 ASSERT_EQ(NextRow(ctx).key, "test4:g");
344 ASSERT_EQ(ctx.Next().GetValue(), exe_end);
345 }
346}
347
348struct ScopedUpdate {
349 engine::Context* db_ctx;

Callers

nothing calls this directly

Calls 11

IndexIFunction · 0.85
ExecutorContextClass · 0.85
NextRowFunction · 0.85
FieldIFunction · 0.85
ScopedUpdatesFunction · 0.85
getMethod · 0.80
GetValueMethod · 0.80
IntervalClass · 0.50
SetMethod · 0.45
NextMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected