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

    https://github.com/apache/spark/pull/11607#discussion_r55898782
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala ---
    @@ -346,14 +376,18 @@ private[client] class Shim_v0_13 extends Shim_v0_12 {
         // Hive getPartitionsByFilter() takes a string that represents 
partition
         // predicates like "str_key=\"value\" and int_key=1 ..."
         val filter = convertFilters(table, predicates)
    -    val partitions =
    -      if (filter.isEmpty) {
    +    val partitions = filter match {
    +      case EmptyPushdown =>
             getAllPartitionsMethod.invoke(hive, 
table).asInstanceOf[JSet[Partition]]
    -      } else {
    -        logDebug(s"Hive metastore filter is '$filter'.")
    -        getPartitionsByFilterMethod.invoke(hive, table, 
filter).asInstanceOf[JArrayList[Partition]]
    -      }
    -
    +      case PartitionExpr(filterExpr) =>
    +        logDebug(s"Hive metastore filter expression is '$filterExpr'.")
    +        getPartitionsByFilterMethod.invoke(hive, table, filterExpr)
    +          .asInstanceOf[JArrayList[Partition]]
    --- End diff --
    
    minor: you could do the `asInstanceOf` in L391.


---
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