You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/26 17:25:33 UTC
[GitHub] [spark] viirya commented on a change in pull request #31656: [SPARK-34548][SQL] Remove unnecessary children from Union under Distince and Deduplicate
viirya commented on a change in pull request #31656:
URL: https://github.com/apache/spark/pull/31656#discussion_r583797946
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -157,8 +157,8 @@ abstract class Optimizer(catalogManager: CatalogManager)
// since the other rules might make two separate Unions operators adjacent.
Batch("Union", Once,
RemoveNoopOperators,
- RemoveNoopUnion,
- CombineUnions) ::
+ CombineUnions,
+ RemoveNoopUnion) ::
Review comment:
Added test is fine. But there will be an [error](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135486/testReport/org.apache.spark.sql/SQLQueryTestSuite/subquery_in_subquery_in_set_operations_sql/) of "Once strategy's idempotence is broken for batch Union".
It is because `CombineUnions` might combine two or more `Union` and they have redundant children under `Distinct`. So the rule order `RemoveNoopUnion` -> `CombineUnions` is not idempotence for Once strategy.
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org