mirror of https://github.com/milvus-io/milvus.git
parent
902307327b
commit
4165b761c9
|
@ -192,6 +192,9 @@ func (context *ParserContext) handleArrayExpr(node *ant_ast.Node, dataType schem
|
|||
}
|
||||
|
||||
func (context *ParserContext) handleInExpr(node *ant_ast.BinaryNode) (*planpb.Expr, error) {
|
||||
if node.Operator != "in" && node.Operator != "not in" {
|
||||
return nil, fmt.Errorf("invalid Operator(%s)", node.Operator)
|
||||
}
|
||||
idNode, ok := node.Left.(*ant_ast.IdentifierNode)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("left operand of the InExpr must be identifier")
|
||||
|
@ -213,6 +216,10 @@ func (context *ParserContext) handleInExpr(node *ant_ast.BinaryNode) (*planpb.Ex
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
if node.Operator == "not in" {
|
||||
return context.createNotExpr(expr)
|
||||
}
|
||||
return expr, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -126,6 +126,7 @@ func TestExprPlan_Str(t *testing.T) {
|
|||
exprStrs := []string{
|
||||
"age >= 420000 && age < 420010", // range
|
||||
"age == 420000 || age == 420001 || age == 420002 || age == 420003 || age == 420004", // term
|
||||
"age not in [1, 2, 3]",
|
||||
}
|
||||
|
||||
for offset, exprStr := range exprStrs {
|
||||
|
|
Loading…
Reference in New Issue