snuyanzin commented on code in PR #27210:
URL: https://github.com/apache/flink/pull/27210#discussion_r2507058877


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/batch/BatchPhysicalCorrelateRule.scala:
##########
@@ -64,7 +64,9 @@ class BatchPhysicalCorrelateRule(config: Config) extends 
ConverterRule(config) {
         case calc: FlinkLogicalCalc =>
           convertToCorrelate(
             calc.getInput.asInstanceOf[RelSubset].getOriginal,
-            Some(calc.getProgram.expandLocalRef(calc.getProgram.getCondition)))
+            if (calc.getProgram.getCondition == null) None
+            else 
Some(calc.getProgram.expandLocalRef(calc.getProgram.getCondition))

Review Comment:
   Without this in case of no condition batch query fails with NPE while 
planning
   
   The approach is similar to the one for stream
   like
   
https://github.com/apache/flink/blob/af86700bbc67eab888553a73dd6b185e5f43d459/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamPhysicalCorrelateRule.scala#L79-L86



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to