This is an automated email from the ASF dual-hosted git repository.

lixiao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new e037a11  [SPARK-28532][SQL] Make optimizer batch "subquery" 
FixedPoint(1)
e037a11 is described below

commit e037a11494b8079d9440899a9e509bb6760bcc43
Author: Yesheng Ma <kimi.y...@gmail.com>
AuthorDate: Fri Jul 26 22:48:42 2019 -0700

    [SPARK-28532][SQL] Make optimizer batch "subquery" FixedPoint(1)
    
    ## What changes were proposed in this pull request?
    In the Catalyst optimizer, the batch subquery actually calls the optimizer 
recursively. Therefore it makes no sense to enforce idempotence on it and we 
change this batch to `FixedPoint(1)`.
    
    ## How was this patch tested?
    Existing UTs.
    
    Closes #25267 from yeshengm/SPARK-28532.
    
    Authored-by: Yesheng Ma <kimi.y...@gmail.com>
    Signed-off-by: gatorsmile <gatorsm...@gmail.com>
---
 .../main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
index 1c36cdc..3efc41d 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
@@ -50,7 +50,6 @@ abstract class Optimizer(sessionCatalog: SessionCatalog)
   override protected val blacklistedOnceBatches: Set[String] =
     Set("Pullup Correlated Expressions",
       "Join Reorder",
-      "Subquery",
       "Extract Python UDFs"
     )
 
@@ -156,7 +155,7 @@ abstract class Optimizer(sessionCatalog: SessionCatalog)
       PropagateEmptyRelation) ::
     Batch("Pullup Correlated Expressions", Once,
       PullupCorrelatedPredicates) ::
-    Batch("Subquery", Once,
+    Batch("Subquery", FixedPoint(1),
       OptimizeSubqueries) ::
     Batch("Replace Operators", fixedPoint,
       RewriteExceptAll,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to