milvus/internal/parser/planparserv2
Yinzuo Jiang 3628593d20
feat: Implement custom function module in milvus expr (#36560)
OSPP 2024 project:
https://summer-ospp.ac.cn/org/prodetail/247410235?list=org&navpage=org

Solutions:

- parser (planparserv2)
    - add CallExpr in planparserv2/Plan.g4
    - update parser_visitor and show_visitor
- grpc protobuf
    - add CallExpr in plan.proto
- execution (`core/src/exec`)
- add `CallExpr` `ValueExpr` and `ColumnExpr` (both logical and
physical) for function call and function parameters
- function factory (`core/src/exec/expression/function`)
    - create a global hashmap when starting milvus (see server.go)
- the global hashmap stores function signatures and their function
pointers, the CallExpr in execution engine can get the function pointer
by function signature.
- custom functions
    - empty(string)
    - starts_with(string, string)
- add cpp/go unittests and E2E tests

closes: #36559

Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-10-25 15:25:30 +08:00
..
generated feat: Implement custom function module in milvus expr (#36560) 2024-10-25 15:25:30 +08:00
check_identical_test.go feat: Implement custom function module in milvus expr (#36560) 2024-10-25 15:25:30 +08:00
check_identical.go Add float16 vector (#25852) 2023-09-08 10:03:16 +08:00
error_listener.go enhance: Update antlr version and refine parsing not in (#36745) 2024-10-11 14:03:21 +08:00
floating_comparision_test.go Support antlr as plan parser (#16696) 2022-05-06 17:43:51 +08:00
floating_comparision.go Support antlr as plan parser (#16696) 2022-05-06 17:43:51 +08:00
generate.go Auto generate parser code (#26716) 2023-08-31 11:13:01 +08:00
generate.sh enhance: Update antlr version and refine parsing not in (#36745) 2024-10-11 14:03:21 +08:00
logical_expr_visitor.go Support antlr as plan parser (#16696) 2022-05-06 17:43:51 +08:00
node_ret.go Fix expression incompatible between parser and executor (#26493) 2023-08-21 19:36:20 +08:00
operators.go Use go-api/v2 for milvus-proto (#24770) 2023-06-09 01:28:37 +08:00
parser_visitor.go feat: Implement custom function module in milvus expr (#36560) 2024-10-25 15:25:30 +08:00
pattern_match_test.go fix: underscore matching not work (#30826) 2024-02-29 10:41:00 +08:00
pattern_match.go fix: underscore matching not work (#30826) 2024-02-29 10:41:00 +08:00
plan_parser_v2_test.go feat: Implement custom function module in milvus expr (#36560) 2024-10-25 15:25:30 +08:00
plan_parser_v2.go enhance: Update antlr version and refine parsing not in (#36745) 2024-10-11 14:03:21 +08:00
Plan.g4 feat: Implement custom function module in milvus expr (#36560) 2024-10-25 15:25:30 +08:00
pool_test.go enhance: Update antlr version and refine parsing not in (#36745) 2024-10-11 14:03:21 +08:00
pool.go enhance: Update antlr version and refine parsing not in (#36745) 2024-10-11 14:03:21 +08:00
README.md enhance: Update antlr version and refine parsing not in (#36745) 2024-10-11 14:03:21 +08:00
show_visitor.go feat: Implement custom function module in milvus expr (#36560) 2024-10-25 15:25:30 +08:00
utils_test.go fix: Fix bug for parsing expression that include quotes (#28416) 2023-11-23 17:18:32 +08:00
utils.go feat: Implement custom function module in milvus expr (#36560) 2024-10-25 15:25:30 +08:00

Generate Parser with Antlr4

Install Antlr4

Please follow install antlr4 to install the antlr tool.

The version of antlr tool: 4.13.2.

Code Generate

After you install the antlr4, you can generate the parser code in golang with:

go generate

All generated code will be under directory generated.