You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/02/18 21:12:08 UTC

[GitHub] [beam] kennknowles commented on a change in pull request #14015: [BEAM-11747] Reject SQL mixed with UDFs

kennknowles commented on a change in pull request #14015:
URL: https://github.com/apache/beam/pull/14015#discussion_r578747912



##########
File path: sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSQLQueryPlanner.java
##########
@@ -160,8 +165,10 @@ static boolean hasOnlyJavaUdfInProjects(RelOptRuleCall x) {
               SqlUserDefinedFunction udf = (SqlUserDefinedFunction) call.op;
               if (udf.function instanceof ZetaSqlScalarFunctionImpl) {
                 ZetaSqlScalarFunctionImpl scalarFunction = (ZetaSqlScalarFunctionImpl) udf.function;
-                if (!scalarFunction.functionGroup.equals(
+                if (scalarFunction.functionGroup.equals(
                     SqlAnalyzer.USER_DEFINED_JAVA_SCALAR_FUNCTIONS)) {
+                  udfs.add(i);
+                } else {

Review comment:
       Is it guaranteed that none of the `RexNode` in `call.getOperands()` contains any subexpression?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org