You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/08/04 01:18:36 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #42315: [SPARK-44653][SQL] Non-trivial DataFrame unions should not break caching

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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -157,7 +157,7 @@ abstract class Optimizer(catalogManager: CatalogManager)
     //   since the other rules might make two separate Unions operators adjacent.
     Batch("Inline CTE", Once,
       InlineCTE()) ::
-    Batch("Union", Once,
+    Batch("Union", fixedPoint,

Review Comment:
   Without the pre-optimization in the dataframe side, some pyspark tests failed complaining that this batch is not idempotent. In fact, this optimization batch does not need to be idempotent, we use `Once` before because we thought it was sufficient, but it's actually not sufficient.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org