2021-10-03 21:17:55 +08:00
|
|
|
# Visitor Pattern
|
|
|
|
Visitor Pattern is used in segcore for parse and execute Execution Plan.
|
|
|
|
|
2021-12-24 12:13:18 +08:00
|
|
|
1. Inside `${core}/src/query/PlanNode.h`, contains physical plan for vector search:
|
2021-10-03 21:17:55 +08:00
|
|
|
1. `FloatVectorANNS` FloatVector search execution node
|
|
|
|
2. `BinaryVectorANNS` BinaryVector search execution node
|
2021-12-24 12:13:18 +08:00
|
|
|
2. `${core}/src/query/Expr.h` contains physical plan for scalar expression:
|
2021-10-03 21:17:55 +08:00
|
|
|
1. `TermExpr` support operation like `col in [1, 2, 3]`
|
|
|
|
2. `RangeExpr` support constant compare with data column like `a >= 5` `1 < b < 2`
|
|
|
|
3. `CompareExpr` support compare with different columns, like `a < b`
|
|
|
|
4. `LogicalBinaryExpr` support and/or
|
|
|
|
5. `LogicalUnaryExpr` support not
|
|
|
|
|
2021-12-30 12:21:46 +08:00
|
|
|
Currently, under `${core/query/visitors}` directory, there are the following visitors:
|
2021-11-16 13:17:25 +08:00
|
|
|
1. `ShowPlanNodeVisitor` prints PlanNode in json
|
2021-10-03 21:17:55 +08:00
|
|
|
2. `ShowExprVisitor` Expr -> json
|
2021-11-15 19:51:47 +08:00
|
|
|
3. `Verify...Visitor` validates ...
|
2021-12-23 10:49:11 +08:00
|
|
|
4. `ExtractInfo...Visitor` extracts info from..., including involved_fields and else
|
2021-11-15 19:51:47 +08:00
|
|
|
5. `ExecExprVisitor` generates bitmask according to expression
|
|
|
|
6. `ExecPlanNodeVistor` physical plan executor only supports ANNS node for now
|