Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7334#discussion_r51959015
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
    @@ -337,8 +337,12 @@ private[sql] abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
             execution.Sample(lb, ub, withReplacement, seed, planLater(child)) 
:: Nil
           case logical.LocalRelation(output, data) =>
             LocalTableScan(output, data) :: Nil
    +      case logical.ReturnAnswer(logical.Limit(IntegerLiteral(limit), 
child)) =>
    +        execution.CollectLimit(limit, planLater(child)) :: Nil
           case logical.Limit(IntegerLiteral(limit), child) =>
    -        execution.Limit(limit, planLater(child)) :: Nil
    +        val perPartitionLimit = execution.LocalLimit(limit, 
planLater(child))
    --- End diff --
    
    Today this will be planned as a `scan -> local limit -> global limit` for 
each branch of the union, which I believe is correct: this query should return 
at most 20 results.
    
    What do you think this test should be asserting?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to