You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/10/18 03:46:53 UTC

[GitHub] [flink] wuchong commented on a change in pull request #9894: [FLINK-14342][table][python] Remove method FunctionDefinition#getLanguage.

wuchong commented on a change in pull request #9894: [FLINK-14342][table][python] Remove method FunctionDefinition#getLanguage.
URL: https://github.com/apache/flink/pull/9894#discussion_r336310564
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/ExpressionReducer.scala
 ##########
 @@ -68,7 +68,7 @@ class ExpressionReducer(
 
       // Skip expressions that contain python functions because it's quite expensive to
       // call Python UDFs during optimization phase. They will be optimized during the runtime.
-      case (_, e) if PythonUtil.containsFunctionOf(e, FunctionLanguage.PYTHON) =>
+      case (_, e) if PythonUtil.containsFunctionOf(e, findPythonFunction = true) =>
 
 Review comment:
   I prefer `containsPythonFunction()` and `containsNonPythonFunction`, because it's more clear than `findPythonFunction = false` flag. Meanwhile, I think `recursive` is also not a very clear flag. So I would suggest following utils:
   
   ```
   boolean containsPythonCall(RexNode)
   boolean containsNonPythonCall(RexNode)
   boolean isPythonCall(RexNode)
   boolean isNonPythonCall(RexNode)
   ```
   
   This also follows `RexUtil.isConstant(RexNode)` and `RexUtil.containsFieldAccess(RexNode)`
   
   

----------------------------------------------------------------
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


With regards,
Apache Git Services