GitHub user viirya opened a pull request:
https://github.com/apache/spark/pull/5241
[SPARK-6586][SQL] Add the capability of retrieving original logical plan of
DataFrame
In order to solve a bug, since #5217, `DataFrame` now uses analyzed plan
instead of logical plan. However, by doing that we can't know the logical plan
of a `DataFrame`. But it might be still useful and important to retrieve the
original logical plan in some use cases.
In this pr, we introduce the capability of retrieving original logical plan
of `DataFrame`.
The approach is that we add an `analyzed` variable to `LogicalPlan`. Once
`Analyzer` finishes analysis, it sets `analyzed` of `LogicalPlan` as `true`.
In `QueryExecution`, we keep the original logical plan in the analyzed plan. In
`LogicalPlan`, a method `originalPlan` is added to recursively replace the
analyzed logical plan with original logical plan and retrieve it.
Besides the capability of retrieving original logical plan, this
modification also can avoid do plan analysis if it is already analyzed.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/viirya/spark-1 df_originalPlan
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5241.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 #5241
----
commit ee1d790b7488135a71db25babe3a7b5ecf3c13ee
Author: Liang-Chi Hsieh <[email protected]>
Date: 2015-03-28T11:58:02Z
Add the function to check if a logical plan is analyzed or not and retrieve
original plan from DataFrame.
----
---
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]