Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17633#discussion_r113597145
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientSuite.scala 
---
    @@ -43,19 +47,159 @@ class HiveClientSuite extends SparkFunSuite {
           properties = Map.empty)
     
         val hadoopConf = new Configuration()
    -    hadoopConf.setBoolean(tryDirectSqlKey, false)
    +    hadoopConf.setBoolean(tryDirectSqlKey, tryDirectSql)
         val client = clientBuilder.buildClient(HiveUtils.hiveExecutionVersion, 
hadoopConf)
    -    client.runSqlHive("CREATE TABLE test (value INT) PARTITIONED BY (part 
INT)")
    +    client
    +      .runSqlHive("CREATE TABLE test (value INT) PARTITIONED BY (ds INT, h 
INT, chunk STRING)")
    +
    +    val partitions =
    +      for {
    +        ds <- 20170101 to 20170103
    +        h <- 0 to 23
    +        chunk <- Seq("aa", "ab", "ba", "bb")
    +      } yield CatalogTablePartition(Map(
    +        "ds" -> ds.toString,
    +        "h" -> h.toString,
    +        "chunk" -> chunk
    +      ), storageFormat)
    +    assert(partitions.size == testPartitionCount)
     
    -    val partitions = (1 to testPartitionCount).map { part =>
    -      CatalogTablePartition(Map("part" -> part.toString), storageFormat)
    -    }
         client.createPartitions(
           "default", "test", partitions, ignoreIfExists = false)
    +    client
    +  }
     
    +  test(s"getPartitionsByFilter returns all partitions when 
$tryDirectSqlKey=false") {
    +    val client = init(false)
         val filteredPartitions = 
client.getPartitionsByFilter(client.getTable("default", "test"),
    -      Seq(EqualTo(AttributeReference("part", IntegerType)(), Literal(3))))
    +      Seq(parseExpression("ds=20170101")))
     
         assert(filteredPartitions.size == testPartitionCount)
       }
    +
    +  test("getPartitionsByFilter: ds=20170101") {
    --- End diff --
    
    will these tests be executed on all supported hive versions?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to