cloud-fan commented on code in PR #54236:
URL: https://github.com/apache/spark/pull/54236#discussion_r2813581437


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -273,7 +273,11 @@ abstract class Optimizer(catalogManager: CatalogManager)
       RemoveNoopOperators),
     // This batch must be executed after the `RewriteSubquery` batch, which 
creates joins.
     Batch("NormalizeFloatingNumbers", Once, NormalizeFloatingNumbers),
-    Batch("ReplaceUpdateFieldsExpression", Once, 
ReplaceUpdateFieldsExpression)))
+    Batch("ReplaceUpdateFieldsExpression", Once, 
ReplaceUpdateFieldsExpression),
+    // Validate that nested SequentialStreamingUnions have been properly 
flattened.
+    // Must run after CombineUnions in the "Union" batch.
+    Batch("Validate SequentialStreamingUnion", Once,
+      ValidateSequentialStreamingUnionNesting)))

Review Comment:
   This is the first time we validate optimized plan only once for a very 
specific case. Shall we turn it into tests? e.g. we make sure the 
SequentialStreamingUnions are flattened by tests, as ideally optimization is an 
improvement, not a must-have.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to