Steve Carlin has submitted this change and it was merged. ( https://gerrit.cloudera.org/25137 )
Change subject: IMPALA-14947: Calcite planner: fix parsing issues ...................................................................... IMPALA-14947: Calcite planner: fix parsing issues This commit fixes several parsing issues in the Calcite planner: - CAST(expression AS type FORMAT pattern) keeps the FORMAT pattern on the SqlNode and passes it through AnalyzedCastExpr, RexCallConverter, and ImpalaConvertletTable. The pattern applies to datetime and character types. - Keywords that are also Impala function names were added to nonReservedKeywords in config.fmpp so the parser accepts them as ordinary function calls. - Support for &&, &, DIV, typeof(), and factorial (!) has been added. - first_value, last_value, trim, and utf8_trim use Impala syntax that differs from Calcite, including IGNORE NULLS inside the parentheses and TRIM's LEADING, TRAILING, BOTH, and FROM clauses. Support for those forms has been added. - ILIKE and RLIKE come from Calcite's SqlLibraryOperators, which is not visible by default. Those operators were added to ImpalaCustomOperatorTable. Change-Id: I5e275f1b0b1f4895a12ac6251e91a39408815a75 Reviewed-on: https://gerrit.cloudera.org/25137 Tested-by: Impala Public Jenkins <[email protected]> Reviewed-by: Steve Carlin <[email protected]> --- M java/calcite-planner/src/main/codegen/config.fmpp M java/calcite-planner/src/main/codegen/templates/Parser.jj M java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/AnalyzedCastExpr.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/FunctionResolver.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/RexCallConverter.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaConvertletTable.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaOperatorTable.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeSystemImpl.java M testdata/workloads/functional-query/queries/QueryTest/calcite.test M testdata/workloads/functional-query/queries/QueryTest/exprs.test M testdata/workloads/functional-query/queries/QueryTest/fallback_planner.test 12 files changed, 253 insertions(+), 36 deletions(-) Approvals: Impala Public Jenkins: Verified Steve Carlin: Looks good to me, approved -- To view, visit https://gerrit.cloudera.org/25137 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5e275f1b0b1f4895a12ac6251e91a39408815a75 Gerrit-Change-Number: 25137 Gerrit-PatchSet: 17 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Fang-Yu Rao <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]>
