GitHub user hvanhovell opened a pull request:
https://github.com/apache/spark/pull/17027
[SPARK-19650] Runnable commands should not trigger a Spark job [WIP]
## What changes were proposed in this pull request?
Spark executes SQL commands eagerly. It does this by materializing an RDD
(which triggers execution of the actual command) with the command's results.
The downside to this approach is that this also triggers a Spark job which
quite expensive and unnecessary.
This PR fixes this by avoiding the materialization of an `RDD` for
`RunnableCommands`; it just calls `executedPlan.collectToIterate` to trigger
the execution and wraps the `executedPlan` with a `MaterializedPlan` to avoid
another execution of the plan.
## How was this patch tested?
*TODO*
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hvanhovell/spark no-job-command
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17027.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 #17027
----
commit 4eea40baf569fe989ac6ec0d723259f1ab886ed3
Author: Herman van Hovell <[email protected]>
Date: 2017-02-17T22:09:02Z
Do not trigger a job for runnable commands unless we have to.
commit bd379340d16ac1f75b4b94cb739fb2db2a18dbb8
Author: Herman van Hovell <[email protected]>
Date: 2017-02-22T13:51:46Z
Introduce materialized plan
----
---
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]