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. I think "contains" already means any 
node matched in the tree. 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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to