This is an automated email from the ASF dual-hosted git repository. csringhofer pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 75e012189099cba3a7f6aa66ef77dbbe0b03235c Author: Steve Carlin <[email protected]> AuthorDate: Tue Nov 12 10:21:16 2024 -0800 IMPALA-13541: Calcite planner, declare explicit_cast in operator table. This fixes a regression caused by IMPALA-13516. The validator finds the explicit_cast function when the cast to timestamp function is present in the query. However, the validator then tries to validate the explicit_cast function which was not present in the operator table. Placing the operator in the table fixes the issue. Change-Id: Ib8577a06178435f5048d0a9721c16069ebe05743 Reviewed-on: http://gerrit.cloudera.org:8080/22057 Reviewed-by: Michael Smith <[email protected]> Tested-by: Michael Smith <[email protected]> --- .../apache/impala/calcite/operators/ImpalaCustomOperatorTable.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java b/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java index 22006f7fd..2a1a2a8a7 100644 --- a/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java +++ b/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java @@ -217,6 +217,11 @@ public class ImpalaCustomOperatorTable extends ReflectiveSqlOperatorTable { null, OperandTypes.STRING_SAME_SAME_OR_ARRAY_SAME_SAME); + // The explicit cast function was created to deal with the cast function using + // Impala behavior. The operator is in the operator table because the Calcite + // validator needs to search for the explicit_cast function while validating. + public static final ImpalaCastFunction EXPLICIT_CAST = ImpalaCastFunction.INSTANCE; + public static ImpalaCustomOperatorTable instance() { return INSTANCE.get(); }
