wangyum opened a new pull request #35301:
URL: https://github.com/apache/spark/pull/35301


   ### What changes were proposed in this pull request?
   
   This pr change the strategy of `Eliminate Limits` batch from Once to 
fixedPoint in AQEOptimizer.
   
   ### Why are the changes needed?
   
   Fix bug. Otherwise check batch idempotence will fail:
   ```scala
   spark.range(10).write.saveAsTable("t1")
   spark.table("t1").distinct().limit(10086).selectExpr("cast(id as 
string)").limit(20).collect()
   ```
   
   ```
   Once strategy's idempotence is broken for batch Eliminate Limits
   !GlobalLimit 20                                                              
                       Project [cast(id#3L as string) AS id#6]
   !+- LocalLimit 20                                                            
                       +- LogicalQueryStage Aggregate [id#3L], [id#3L], 
HashAggregate(keys=[id#3L], functions=[])
   !   +- Project [cast(id#3L as string) AS id#6]                               
                       
   !      +- LogicalQueryStage Aggregate [id#3L], [id#3L], 
HashAggregate(keys=[id#3L], functions=[])   
     
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   
   ### How was this patch tested?
   
   Unit test.


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