gustavodemorais commented on code in PR #28403:
URL: https://github.com/apache/flink/pull/28403#discussion_r3412982997


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/optimize/program/FlinkChangelogModeInferenceProgram.scala:
##########
@@ -114,9 +114,24 @@ class FlinkChangelogModeInferenceProgram extends 
FlinkOptimizeProgram[StreamOpti
 
     // step4: 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)
+      val errorMessage =
+        if (containsUpdates(rootWithModifyKindSet)) {
+          // Point at the failing node and its inputs instead of dumping the 
whole plan.

Review Comment:
   Maybe add smth like this as a comment
   
   
   
   ```
     // An empty result means no consistent UpdateKind/DeleteKind assignment 
exists. When the
     // plan carries updates, the only way this happens is an upsert producer 
(UPDATE_AFTER only)
     // feeding a consumer that needs a retract changelog (UPDATE_BEFORE and 
UPDATE_AFTER), so we
     // can point at that mismatch. Otherwise we fall back to dumping the whole 
plan.
   ```



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