Github user jinxing64 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19602#discussion_r191204885
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala ---
@@ -657,18 +656,41 @@ 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 @ Cast(child, dt, _) if
!Cast.mayTruncate(child.dataType, dt) => unapply(child)
+ case _ => None
+ }
+ }
+ }
+
+ def decoratedValue(attr: Attribute, value: String): String = {
--- End diff --
e.g.
dt="20180101" if dt is of NumericType, we remove the quote and it changes
to be dt=20180101
dt=201880101 if dt is of StringType, we add the quote and it changes to be
dt="20180101"
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]