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

    https://github.com/apache/spark/pull/19602#discussion_r192576685
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala ---
    @@ -657,17 +656,29 @@ private[client] class Shim_v0_13 extends Shim_v0_12 {
     
         val useAdvanced = SQLConf.get.advancedPartitionPredicatePushdownEnabled
     
    +    object ExtractAttribute {
    +      def unapply(expr: Expression): Option[Attribute] = {
    +        expr match {
    +          case attr: Attribute => Some(attr)
    +          case Cast(child, dt, _) if !Cast.mayTruncate(child.dataType, dt) 
=> unapply(child)
    +          case _ => None
    +        }
    +      }
    +    }
    +
         def convert(expr: Expression): Option[String] = expr match {
           case In(NonVarcharAttribute(name), ExtractableLiterals(values)) if 
useAdvanced =>
    --- End diff --
    
    shall we apply the cast handling here?


---

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

Reply via email to