You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[fix](search) Make AND/OR/NOT operators case-sensitive in search DSL
Per specification requirement #5, only uppercase AND/OR/NOT
should be recognized as operators in search DSL. Lowercase and/or/not
should be treated as regular terms, causing parse errors when used
as operators.
Changes:
- Update SearchLexer.g4 to only match uppercase keywords
- Update unit tests to expect parse errors for lowercase operators
- Update regression tests accordingly
- Add comprehensive DSL operator test cases
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy file name to clipboardExpand all lines: fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SearchDslParserTest.java
+18-25Lines changed: 18 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -872,16 +872,13 @@ public void testUppercaseAndOperator() {
872
872
873
873
@Test
874
874
publicvoidtestLowercaseAndOperator() {
875
-
// Test: Currently lowercase 'and' is also treated as operator
876
-
// According to PDF requirement, only uppercase should be operators
877
-
// This test documents current behavior - may need to change
875
+
// Lowercase 'and' is NOT an operator in ANTLR grammar (case-sensitive).
876
+
// With bareQuery rule, it's parsed as a bare term without field.
877
+
// Without default_field, bare term throws exception.
878
878
Stringdsl = "field:a and field:b";
879
-
QsPlanplan = SearchDslParser.parseDsl(dsl);
880
-
881
-
Assertions.assertNotNull(plan);
882
-
// Current behavior: lowercase 'and' IS an operator
0 commit comments