WeiZhong94 commented on a change in pull request #14492: URL: https://github.com/apache/flink/pull/14492#discussion_r548843229
########## File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/PythonCalcSplitRule.scala ########## @@ -168,12 +168,34 @@ abstract class PythonCalcSplitProjectionRuleBase(description: String) } } +abstract class PythonCalcSplitRexFieldRuleBase(description: String) + extends PythonCalcSplitRuleBase(description) { + + override def needConvert(program: RexProgram, node: RexNode): Boolean = { + node match { + case x: RexFieldAccess => x.getReferenceExpr match { + case y: RexLocalRef if isPythonCall(program.expandLocalRef(y)) => true + case _ => false + } + case _ => false + } + } + + protected def containsFieldAccessAfterPythonCall(node: RexNode): Boolean = { + node match { + case call: RexCall => call.getOperands.exists(containsFieldAccessAfterPythonCall) + case x: RexFieldAccess => isPythonCall(x.getReferenceExpr) Review comment: We should call the `containsFieldAccessAfterPythonCall` here if the expression is not a python call to handle the situation like `where javaRowFunc(pyRowFunc5(a)).f0 is NULL`. And maybe we can combine this logic into `FunctionFinder` as the field access, java call, python call may appear alternately. That should be able to better to cover various situations. ---------------------------------------------------------------- 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