spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viirya <...@git.apache.org>
Subject [GitHub] spark issue #18687: [SPARK-21484][SQL] Fix inconsistent query plans of Datas...
Date Sat, 22 Jul 2017 14:10:03 GMT
Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/18687
  
    There is another case we should fix. You can see the storage level of ds2 is StorageLevel.NONE,
but its executed plan is still cached version. 
    
        scala> Seq("1", "2").toDF().write.saveAsTable("t")
        scala> val ds1 = spark.table("t")
        ds1: org.apache.spark.sql.DataFrame = [value: string]
        scala> val ds2 = spark.table("t")
        ds2: org.apache.spark.sql.DataFrame = [value: string]
    
        scala> ds1.persist()
        res1: ds1.type = [value: string]
    
        scala> ds2.queryExecution.executedPlan
        res2: org.apache.spark.sql.execution.SparkPlan =
        InMemoryTableScan [value#11]
           +- InMemoryRelation [value#11], true, 10000, StorageLevel(disk, memory, deserialized,
1 replicas)
                 +- *FileScan parquet default.t[value#7] Batched: true, Format: Parquet, Location:
InMemoryFileIndex[file:/root/repos/spark-1/spark-warehouse/t], PartitionFilters: [], PushedFilters:
[], ReadSchema: struct<value:string>
    
        scala> ds1.unpersist()
        res3: ds1.type = [value: string]
    
        scala> ds2.queryExecution.executedPlan
        res4: org.apache.spark.sql.execution.SparkPlan =
        InMemoryTableScan [value#11]
           +- InMemoryRelation [value#11], true, 10000, StorageLevel(disk, memory, deserialized,
1 replicas)
                 +- *FileScan parquet default.t[value#7] Batched: true, Format: Parquet, Location:
InMemoryFileIndex[file:/root/repos/spark-1/spark-warehouse/t], PartitionFilters: [], PushedFilters:
[], ReadSchema: struct<value:string>
        scala> ds2.storageLevel
        res5: org.apache.spark.storage.StorageLevel = StorageLevel(1 replicas)
    
    



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message