Github user JoshRosen commented on the pull request:
https://github.com/apache/spark/pull/7334#issuecomment-122429953
@chenghao-intel:
They are not equivalent in terms of data shuffling, which is why I
introduced `CollectLimit`. In the old code, calling `executeCollect` on a
`Limit` operator would end up running a code path which skips the shuffle after
the per-partition limits and uses `executeTake` to try to only compute as many
partitions as are necessary to answer the query. `execution.Limit(global =
true, limit, execution.Limit(global=false, limit, child))`, on the other hand,
will end up involving a shuffle, so we'll end up calling `executeTake` on an
RDD with a single partition, preventing it from being able to do less work.
---
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]