Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/22263#discussion_r225605943
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala ---
@@ -288,6 +297,65 @@ class CachedTableSuite extends QueryTest with
SQLTestUtils with SharedSQLContext
}
}
+ test("SQL interface support storageLevel(DISK_ONLY)") {
+ sql("CACHE TABLE testData OPTIONS('storageLevel' 'DISK_ONLY')")
+ assertCached(spark.table("testData"))
+ val rddId = rddIdOf("testData")
+ assert(isExpectStorageLevel(rddId, Disk))
+ spark.catalog.uncacheTable("testData")
+ }
+
+ test("SQL interface select from table support storageLevel(DISK_ONLY)") {
+ sql("CACHE TABLE testSelect OPTIONS('storageLevel' 'DISK_ONLY') SELECT
* FROM testData")
+ assertCached(spark.table("testSelect"))
+ val rddId = rddIdOf("testSelect")
+ assert(isExpectStorageLevel(rddId, Disk))
+ spark.catalog.uncacheTable("testSelect")
+ }
+
+ test("SQL interface support storageLevel(DISK_ONLY) with invalid
options") {
+ sql("CACHE TABLE testData OPTIONS('storageLevel' 'DISK_ONLY', 'a' '1',
'b' '2')")
+ assertCached(spark.table("testData"))
+ val rddId = rddIdOf("testData")
+ assert(isExpectStorageLevel(rddId, Disk))
+ spark.catalog.uncacheTable("testData")
--- End diff --
ditto.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]