From bbcf89dfcefb131916bd93063a0b36b06d6b0011 Mon Sep 17 00:00:00 2001 From: bipinprasad Date: Tue, 10 Jan 2023 14:37:40 -0500 Subject: [PATCH 1/3] [STORM-3884] Bump calcite-core from 1.14.0 to 1.32.0 --- pom.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 95ad0780fbd..cdd966d190b 100644 --- a/pom.xml +++ b/pom.xml @@ -15,8 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + 4.0.0 @@ -127,7 +126,7 @@ 2.1.10 2.2 5.2.2 - 1.16.0 + 1.32.0 2.9.0 5.18.2 From dbda79b4980c02ce260049442d9245f441c8baa0 Mon Sep 17 00:00:00 2001 From: bipinprasad Date: Wed, 11 Jan 2023 15:12:35 -0500 Subject: [PATCH 2/3] [STORM-3884] Partially complete migration to calcite 1.34.0 --- pom.xml | 1 + .../src/codegen/data/Parser.tdd | 24 ++++++++++++++++++- .../storm/sql/parser/ColumnConstraint.java | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cdd966d190b..0fe5f007914 100644 --- a/pom.xml +++ b/pom.xml @@ -126,6 +126,7 @@ 2.1.10 2.2 5.2.2 + 1.32.0 2.9.0 5.18.2 diff --git a/sql/storm-sql-core/src/codegen/data/Parser.tdd b/sql/storm-sql-core/src/codegen/data/Parser.tdd index b0dccb6fb35..5fc2f201018 100644 --- a/sql/storm-sql-core/src/codegen/data/Parser.tdd +++ b/sql/storm-sql-core/src/codegen/data/Parser.tdd @@ -35,7 +35,13 @@ "PARALLELISM", "STORED", "TBLPROPERTIES", - "JAR" + "JAR", + "NEGATE", + "TILDE" + ] + + # List of joinTypes. + joinTypes: [ ] # List of methods for parsing custom SQL statements. @@ -65,6 +71,21 @@ dropStatementParserMethods: [ ] + extraBinaryExpressions: [ + ] + + builtinFunctionCallMethods: [ + ] + + nonReservedKeywordsToAdd: [ + "userkeyword1", + "userkeyword2", + "userkeyword3" + ] + + binaryOperatorsTokens: [ + ] + # List of files in @includes directory that have parser method # implementations for custom SQL statements, literals or types # given as part of "statementParserMethods", "literalParserMethods" or @@ -73,6 +94,7 @@ "parserImpls.ftl" ] + includePosixOperators: true includeCompoundIdentifier: true, includeBraces: true, includeAdditionalDeclarations: false, diff --git a/sql/storm-sql-core/src/jvm/org/apache/storm/sql/parser/ColumnConstraint.java b/sql/storm-sql-core/src/jvm/org/apache/storm/sql/parser/ColumnConstraint.java index 3be6bc988fd..5ab06056346 100644 --- a/sql/storm-sql-core/src/jvm/org/apache/storm/sql/parser/ColumnConstraint.java +++ b/sql/storm-sql-core/src/jvm/org/apache/storm/sql/parser/ColumnConstraint.java @@ -19,7 +19,7 @@ public class ColumnConstraint extends SqlLiteral { private ColumnConstraint( - Object value, SqlTypeName typeName, SqlParserPos pos) { + SqlDdlKeywords value, SqlTypeName typeName, SqlParserPos pos) { super(value, typeName, pos); } From 3caa1533f5388e0e0fcb4c53feb3187afc08f0a3 Mon Sep 17 00:00:00 2001 From: bipinprasad Date: Thu, 12 Jan 2023 10:32:36 -0500 Subject: [PATCH 3/3] [STORM-3884] Further updates to get past some errors - WIP --- sql/storm-sql-core/pom.xml | 16 +++++++++++++--- sql/storm-sql-core/src/codegen/data/Parser.tdd | 14 ++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/sql/storm-sql-core/pom.xml b/sql/storm-sql-core/pom.xml index 3625f941240..4d775b10ea2 100644 --- a/sql/storm-sql-core/pom.xml +++ b/sql/storm-sql-core/pom.xml @@ -46,7 +46,7 @@ ricetons@gmail.com - + org.apache.storm @@ -142,6 +142,16 @@ 4.1 test + + com.google.guava + guava + ${guava.version} + + + org.immutables + value + 2.9.3 + src/jvm @@ -266,7 +276,7 @@ org.freemarker freemarker - 2.3.25-incubating + 2.3.31 @@ -306,7 +316,7 @@ org.codehaus.mojo javacc-maven-plugin - 3.0.0 + 3.0.1 generate-sources diff --git a/sql/storm-sql-core/src/codegen/data/Parser.tdd b/sql/storm-sql-core/src/codegen/data/Parser.tdd index 5fc2f201018..496a71c166c 100644 --- a/sql/storm-sql-core/src/codegen/data/Parser.tdd +++ b/sql/storm-sql-core/src/codegen/data/Parser.tdd @@ -59,7 +59,15 @@ dataTypeParserMethods: [ ] + # if this list is empty then an empty "()" section is generated and it leads to parsing error in calcite 1.17.0 + # and higher. Use three keywords arbitrarily chosen to have least impact if removed. nonReservedKeywords: [ + "SPACE", + "UPSERT" + ] + + nonReservedKeywordsToAdd: [ + "ALTER" ] createStatementParserMethods: [ @@ -77,12 +85,6 @@ builtinFunctionCallMethods: [ ] - nonReservedKeywordsToAdd: [ - "userkeyword1", - "userkeyword2", - "userkeyword3" - ] - binaryOperatorsTokens: [ ]