diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e78ccc921de87..19e6c6c391148 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -14,6 +14,7 @@ 1. Agent: Simplify the use of Agent's Docker Image - [#33356](https://github.com/apache/shardingsphere/pull/33356) 1. Add arguments not null check when creating RouteUnit - [#33382](https://github.com/apache/shardingsphere/pull/33382) 1. Add index columns not empty judgement for IndexColumnTokenGenerator - [#33384](https://github.com/apache/shardingsphere/pull/33384) +1. SQL Parser: Support parsing Doris STRRIGHT - [#33393](https://github.com/apache/shardingsphere/pull/33393) ### Bug Fixes diff --git a/parser/sql/dialect/doris/src/main/antlr4/imports/doris/BaseRule.g4 b/parser/sql/dialect/doris/src/main/antlr4/imports/doris/BaseRule.g4 index 48dd6589235cd..8cf25e65a6395 100644 --- a/parser/sql/dialect/doris/src/main/antlr4/imports/doris/BaseRule.g4 +++ b/parser/sql/dialect/doris/src/main/antlr4/imports/doris/BaseRule.g4 @@ -471,6 +471,9 @@ identifierKeywordsUnambiguous | STORAGE | STREAM | STRING + // DORIS ADDED BEGIN + | STRRIGHT + // DORIS ADDED END | SUBCLASS_ORIGIN // | SUBDATE | SUBJECT @@ -1207,7 +1210,11 @@ regularFunctionName | DATABASE | SCHEMA | LEFT | RIGHT | DATE | DAY | GEOMETRYCOLLECTION | REPEAT | LINESTRING | MULTILINESTRING | MULTIPOINT | MULTIPOLYGON | POINT | POLYGON | TIME | TIMESTAMP | TIMESTAMP_ADD | TIMESTAMP_DIFF | DATE | CURRENT_TIMESTAMP - | CURRENT_DATE | CURRENT_TIME | UTC_TIMESTAMP | identifier + | CURRENT_DATE | CURRENT_TIME | UTC_TIMESTAMP + // DORIS ADDED BEGIN + | STRRIGHT + // DORIS ADDED END + | identifier ; matchExpression diff --git a/parser/sql/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4 b/parser/sql/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4 index ea4003474cc8b..57e5d9facf9f7 100644 --- a/parser/sql/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4 +++ b/parser/sql/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4 @@ -1073,7 +1073,7 @@ INSTANCE : I N S T A N C E ; -// DORIS ADDED BEOIM +// DORIS ADDED BEGIN INSTR : I N S T R ; @@ -2558,6 +2558,12 @@ STRING : S T R I N G ; +// DORIS ADDED BEGIN +STRRIGHT + : S T R R I G H T + ; +// DORIS ADDED END + SUBCLASS_ORIGIN : S U B C L A S S UL_ O R I G I N ; diff --git a/test/it/parser/src/main/resources/case/dml/select-special-function.xml b/test/it/parser/src/main/resources/case/dml/select-special-function.xml index f04eef1ed2c63..696568f2e0828 100644 --- a/test/it/parser/src/main/resources/case/dml/select-special-function.xml +++ b/test/it/parser/src/main/resources/case/dml/select-special-function.xml @@ -2967,7 +2967,7 @@ - @@ -4247,4 +4247,20 @@ + diff --git a/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml b/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml index 5bbc93a7a184c..69b828139843d 100644 --- a/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml +++ b/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml @@ -176,7 +176,7 @@ - + @@ -246,4 +246,5 @@ +