Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22263#discussion_r226534798
  
    --- 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 --
    
    Do you think the previously existing `lazy`-related test cases protect this 
new SQL syntax contribution from future regressions?


---

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

Reply via email to