GitHub user viirya opened a pull request:
https://github.com/apache/spark/pull/11817
[SPARK-13908][SQL] Add a LocalLimit for CollectLimit operator for early
pushdown
## What changes were proposed in this pull request?
JIRA: https://issues.apache.org/jira/browse/SPARK-13908
Currently we use a `CollectLimit` plan for the limit operator as latest
operator to collect data. As it has to be the latest plan, we can't pushdown it
to reduce the data as early as possible. This patch adds an additional
`LocalLimit` after `CollectLimit` for this issue. As `LocalLimit` already
supports wholestage codegen, it can also be integrated in the
`WholeStageCodegen` plan.
The executed plan without this patch:
CollectLimit 5
+- WholeStageCodegen
: +- Range 0, 1, 2, 10, [id#0L]
The executed plan with this patch:
CollectLimit 5
+- WholeStageCodegen
: +- LocalLimit 5
: +- Range 0, 1, 2, 10, [id#0L]
## How was this patch tested?
Existing tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/viirya/spark-1 improve-collect-limit
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11817.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11817
----
commit 33305dfda1d139fea36f46fd9a50dbfe7e923fd2
Author: Liang-Chi Hsieh <[email protected]>
Date: 2016-03-16T07:38:08Z
init import.
commit 407648873b8926da80ba351ab0eb2f47847e0be4
Author: Liang-Chi Hsieh <[email protected]>
Date: 2016-03-18T08:13:43Z
Merge remote-tracking branch 'upstream/master' into improve-collect-limit
----
---
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]