Github user mallman commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22614#discussion_r223425011
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientSuite.scala 
---
    @@ -79,12 +82,30 @@ class HiveClientSuite(version: String)
         client = init(true)
       }
     
    -  test(s"getPartitionsByFilter returns all partitions when 
$tryDirectSqlKey=false") {
    -    val client = init(false)
    -    val filteredPartitions = 
client.getPartitionsByFilter(client.getTable("default", "test"),
    -      Seq(attr("ds") === 20170101))
    +  test(s"getPartitionsByFilter returns all partitions when 
$partPruningFallbackKey=true") {
    +    
withSQLConf(SQLConf.HIVE_METASTORE_PARTITION_PRUNING_FALLBACK_ENABLED.key -> 
"true",
    +        SQLConf.HIVE_METASTORE_PARTITION_PRUNING.key -> "true") {
    +      val client = init(false)
    +      // tryDirectSql = false and a non-string partition filter will 
always fail. This condition
    +      // is used to test if the fallback works
    +      val filteredPartitions = 
client.getPartitionsByFilter(client.getTable("default", "test"),
    +        Seq(attr("ds") === 20170101))
     
    -    assert(filteredPartitions.size == testPartitionCount)
    +      assert(filteredPartitions.size == testPartitionCount)
    +    }
    +  }
    +
    +  test(s"getPartitionsByFilter should throw an exception if 
$partPruningFallbackKey=false") {
    --- End diff --
    
    Change test name to
    
    ```
    s"getPartitionsByFilter should throw an exception when 
$tryDirectSqlKey=false and $partPruningFallbackKey=false"
    ```
    
    ?


---

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

Reply via email to