MCPcopy Create free account
hub / github.com/alibaba/zvec / TEST_F

Function TEST_F

tests/db/sqlengine/optimizer_test.cc:94–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92
93
94TEST_F(OptimizerTest, Basic) {
95 SearchQuery query;
96 query.output_fields_ = {"*"};
97 query.topk_ = 11;
98 query.target_.field_name_ = "face_feature";
99 query.include_vector_ = false;
100 query.filter_ = "age > 200";
101
102 auto engine = std::make_shared<SQLEngineImpl>(std::make_shared<Profiler>());
103 auto ret = engine->build_query_info(schema, query, nullptr);
104 ASSERT_TRUE(ret.has_value());
105 QueryInfo::Ptr query_info = ret.value();
106
107 Optimizer::Ptr optimizer =
108 std::make_shared<MockInvertCondOptimizer>(schema.get());
109
110 auto segment = std::make_shared<MockSegment>();
111
112 bool optimized = optimizer->optimize(segment.get(), query_info.get());
113 ASSERT_TRUE(optimized);
114}
115
116// case 1. invert subroot same as invert cond, do nothing
117TEST_F(OptimizerTest, Case1) {

Callers

nothing calls this directly

Calls 5

build_query_infoMethod · 0.80
has_valueMethod · 0.45
valueMethod · 0.45
getMethod · 0.45
optimizeMethod · 0.45

Tested by

no test coverage detected