mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 02:05:41 +00:00
fix: more accurate error processing for not element_filter (#48447)
issue: https://github.com/milvus-io/milvus/issues/48413 ref: https://github.com/milvus-io/milvus/issues/42148 Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
This commit is contained in:
@@ -1102,6 +1102,9 @@ func (v *ParserVisitor) VisitUnary(ctx *parser.UnaryContext) interface{} {
|
||||
if isRandomSampleExpr(childExpr) {
|
||||
return errors.New("random sample expression cannot be used in unary expression")
|
||||
}
|
||||
if isElementFilterExpr(childExpr) {
|
||||
return errors.New("element filter expression cannot be used in unary expression")
|
||||
}
|
||||
|
||||
if err := checkDirectComparisonBinaryField(toColumnInfo(childExpr)); err != nil {
|
||||
return err
|
||||
|
||||
@@ -2563,6 +2563,9 @@ func TestExpr_ElementFilter(t *testing.T) {
|
||||
|
||||
`element_filter(struct_array, $[sub_int] > 1) || element_filter(struct_array, $[sub_str] == "test")`,
|
||||
`element_filter(struct_array, $[sub_int] > 1) && Int64Field > 0`,
|
||||
|
||||
`not element_filter(struct_array, $[sub_int] > 1)`,
|
||||
`!element_filter(struct_array, $[sub_int] > 1)`,
|
||||
}
|
||||
|
||||
for _, expr := range invalidExprs {
|
||||
|
||||
Reference in New Issue
Block a user