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 2020/12/27 09:24:56 UTC

[GitHub] [flink] HuangXingBo commented on a change in pull request #14492: [FLINK-20756][python] Add PythonCalcSplitConditionRexFieldRule

HuangXingBo commented on a change in pull request #14492:
URL: https://github.com/apache/flink/pull/14492#discussion_r549088373



##########
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:
       Yes, current logic can't deal with the case of `where javaRowFunc(pyRowFunc5(a)).f0 is NULL`. We need to change `isPythonCall ` to `containsPythonCall` and add the logic of `visitFieldAccess` into the `FunctionFinder` of `PythonUtil`




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