fix: exists should have a higher priority (#40864)

issue: #40837

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2025-03-26 20:02:34 +08:00 committed by GitHub
parent 4220e3355d
commit e2e1493580
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 281 additions and 279 deletions

View File

@ -11,6 +11,7 @@ expr:
| '(' expr ')' # Parens
| '[' expr (',' expr)* ','? ']' # Array
| EmptyArray # EmptyArray
| EXISTS expr # Exists
| expr LIKE StringLiteral # Like
| TEXTMATCH'('Identifier',' StringLiteral')' # TextMatch
| PHRASEMATCH'('Identifier',' StringLiteral (',' expr)? ')' # PhraseMatch
@ -37,8 +38,7 @@ expr:
| expr AND expr # LogicalAnd
| expr OR expr # LogicalOr
| Identifier ISNULL # IsNull
| Identifier ISNOTNULL # IsNotNull
| EXISTS expr # Exists;
| Identifier ISNOTNULL # IsNotNull;
// typeName: ty = (BOOL | INT8 | INT16 | INT32 | INT64 | FLOAT | DOUBLE);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -948,6 +948,8 @@ func Test_JSONExpr(t *testing.T) {
`100 == $meta["A"] + 6`,
`exists $meta["A"]`,
`exists $meta["A"]["B"]["C"] `,
`exists $meta["A"] || exists JSONField["A"]`,
`exists $meta["A"] && exists JSONField["A"]`,
`A["B"][0] > 100`,
`$meta[0] > 100`,
`A["\"\"B\"\""] > 10`,