Github user wangyum commented on a diff in the pull request:
https://github.com/apache/spark/pull/22263#discussion_r226514429
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala ---
@@ -325,6 +325,21 @@ class CachedTableSuite extends QueryTest with
SQLTestUtils with SharedSQLContext
assert(isExpectStorageLevel(rddId, Memory))
}
+ test("SQL interface support storageLevel(Invalid StorageLevel)") {
+ val message = intercept[IllegalArgumentException] {
+ sql("CACHE TABLE testData OPTIONS('storageLevel'
'invalid_storage_level')")
+ }.getMessage
+ assert(message.contains("Invalid StorageLevel: INVALID_STORAGE_LEVEL"))
+ }
+
+ test("SQL interface support storageLevel(with LAZY)") {
+ sql("CACHE LAZY TABLE testData OPTIONS('storageLevel' 'disk_only')")
+ assertCached(spark.table("testData"))
+ val rddId = rddIdOf("testData")
+ sql("SELECT COUNT(*) FROM testData").collect()
+ assert(isExpectStorageLevel(rddId, Disk))
--- End diff --
Yes, I think this test cast is mainly to assert that `storageLevel` works
with `lazy`, not `lazy` itself. WDYT?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]