Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/7334#discussion_r34522980
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
@@ -332,8 +332,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.Limit(IntegerLiteral(limit), child) =>
- execution.Limit(limit, planLater(child)) :: Nil
+ case logical.Limit(IntegerLiteral(limit), child) => {
+ val perPartitionLimit = execution.PartitionLocalLimit(limit,
planLater(child))
+ val globalLimit = execution.PartitionLocalLimit(
+ limit, execution.Exchange(SinglePartition, Nil,
perPartitionLimit))
--- End diff --
Good idea. I think we'll have to add something akin to `partial=True` so
that we can handle the per-partition and global limits properly. I'll push
another commit shortly to explore this option.
---
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]