GitHub user viirya opened a pull request:
https://github.com/apache/spark/pull/18687
[SPARK-21484][SQL] Fix inconsistent query plans of Dataset after
persist/unpersist
## What changes were proposed in this pull request?
After the call of persist/unpersis, the query plans of a `Dataset` should
be changed accordingly. But currently the query plans are the same. So you will
see the inconsistent query plans like:
scala> val x1 = Seq(1).toDF()
x1: org.apache.spark.sql.DataFrame = [value: int]
scala> println(x1.queryExecution.executedPlan) // query plans are
materialized before persist()
LocalTableScan [value#1]
scala> x1.persist()
scala> x1.count()
scala> println(x1.queryExecution.executedPlan)
LocalTableScan [value#1]
scala> val x1 = Seq(1).toDF()
x1: org.apache.spark.sql.DataFrame = [value: int]
scala> x1.persist()
scala> x1.count()
scala> println(x1.queryExecution.executedPlan) // query plans are
materialized after persist()
InMemoryTableScan [value#24]
+- InMemoryRelation [value#24], true, 10000, StorageLevel(disk,
memory, deserialized, 1 replicas)
+- LocalTableScan [value#1]
scala> x1.unpersist()
scala> println(x1.queryExecution.executedPlan)
InMemoryTableScan [value#24]
+- InMemoryRelation [value#24], true, 10000, StorageLevel(disk,
memory, deserialized, 1 replicas)
+- LocalTableScan [value#1]
## How was this patch tested?
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/viirya/spark-1 SPARK-21484
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18687.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 #18687
----
commit 6b21c6b2408dcbc6fec938dba94eeb5d70387b2e
Author: Liang-Chi Hsieh <[email protected]>
Date: 2017-07-20T07:12:00Z
Change query execution instance after persist/unpersist.
----
---
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]