Michael Smith has submitted this change and it was merged. ( https://gerrit.cloudera.org/25136 )
Change subject: IMPALA-15566: Calcite Planner: Fixes for UDF tests ...................................................................... IMPALA-15566: Calcite Planner: Fixes for UDF tests There are two main problems fixed in this commit for UDFs on Calcite. 1) The tests use a function called "identity" which was being treated as a keyword in Calcite. It is no longer being treated as a keyword. 2) Authorization needs to be checked for UDF functions. In order to handle this, a separate runtime Calcite "OperatorTable" is created within the CalciteAnalyzerDriver during the validation. The existing ImpalaOperatorTable contains all the builtin functions. When the UDF is not found there, it goes into the chained ImpalaOperatorTable, it tracks the the function has been used, and it creates a new operator. After all validation is done, the newly tracked functions can be analyzed for authorization. Many of the changes here support tracking the db associated with the operator and ensuring that the function can be resolved in the FunctionResolver. Two Jiras have been created for issues in the UDFs that are still not supported. - IMPALA-15565: The profile does not yet contain the UDF information - IMPALA-15564: the query option to support a fallback db for the function is not yet supported One test still fails when the fallback planner is not set, but this will be resolved in a separate issue because it involves the parsing of the "&" which is out of scope for this commit. Testing: Ran test_udfs.py with a custom version where the fallback planner is shut off. This feature is near completion, and will be tested as part of a Jenkins run in the near future. Change-Id: I942745790b629ac7e4b11f61c8e076c0635d1f5e Reviewed-on: https://gerrit.cloudera.org/25136 Reviewed-by: Michael Smith <[email protected]> Tested-by: Michael Smith <[email protected]> --- M java/calcite-planner/src/main/codegen/templates/Parser.jj M java/calcite-planner/src/main/java/org/apache/impala/calcite/coercenodes/CoerceNodes.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/AnalyzedFunctionCallExpr.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/functions/RexLiteralConverter.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaAdjustScaleFunction.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaAggOperator.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaOperator.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/rel/node/ImpalaAggRel.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaAnalyticRel.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaJoinRel.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteAnalysisDriver.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteCompilerFactory.java M java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteStats.java M java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestLoptJoinRule.java M java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestReduceExprShuttle.java M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q87.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q87.test M testdata/workloads/functional-query/queries/QueryTest/calcite.test M testdata/workloads/functional-query/queries/QueryTest/java-udf.test M testdata/workloads/functional-query/queries/QueryTest/udf.test M tests/query_test/test_udfs.py 25 files changed, 319 insertions(+), 117 deletions(-) Approvals: Michael Smith: Looks good to me, approved; Verified -- To view, visit https://gerrit.cloudera.org/25136 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I942745790b629ac7e4b11f61c8e076c0635d1f5e Gerrit-Change-Number: 25136 Gerrit-PatchSet: 12 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aman Sinha <[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]>
