JingsongLi commented on a change in pull request #12803:
URL: https://github.com/apache/flink/pull/12803#discussion_r448738985



##########
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/optimize/program/FlinkChangelogModeInferenceProgram.scala
##########
@@ -66,15 +66,29 @@ class FlinkChangelogModeInferenceProgram extends 
FlinkOptimizeProgram[StreamOpti
       // try ONLY_UPDATE_AFTER first, and then BEFORE_AND_AFTER
       Seq(UpdateKindTrait.ONLY_UPDATE_AFTER, UpdateKindTrait.BEFORE_AND_AFTER)
     }
+    var throwable: Throwable = null
     val finalRoot = requiredUpdateKindTraits.flatMap { requiredUpdateKindTrait 
=>
-      SATISFY_UPDATE_KIND_TRAIT_VISITOR.visit(rootWithModifyKindSet, 
requiredUpdateKindTrait)
+      try {
+        SATISFY_UPDATE_KIND_TRAIT_VISITOR.visit(rootWithModifyKindSet, 
requiredUpdateKindTrait)
+      } catch {
+        case t: Throwable =>
+          // cache exception and return None to
+          throwable = t
+          None
+      }
     }
 
     // step3: sanity check and return non-empty root
     if (finalRoot.isEmpty) {
       val plan = FlinkRelOptUtil.toString(root, withChangelogTraits = true)
-      throw new TableException(
-        "Can't generate a valid execution plan for the given query:\n" + plan)
+      if (throwable == null) {

Review comment:
       Can we test this branch?




----------------------------------------------------------------
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:
[email protected]


Reply via email to