wangyum commented on a change in pull request #23788: [SPARK-27176][SQL]
Upgrade hadoop-3's built-in Hive maven dependencies to 2.3.4
URL: https://github.com/apache/spark/pull/23788#discussion_r272283501
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala
##########
@@ -160,31 +175,50 @@ private[orc] object OrcFilters extends Logging {
// wrapped by a "parent" predicate (`And`, `Or`, or `Not`).
case EqualTo(attribute, value) if
isSearchableType(dataTypeMap(attribute)) =>
- Some(builder.startAnd().equals(attribute, value).end())
+ val bd = builder.startAnd()
+ val method = findMethod(bd.getClass, "equals", classOf[String],
classOf[Object])
+ Some(method.invoke(bd, attribute,
value.asInstanceOf[AnyRef]).asInstanceOf[Builder].end())
Review comment:
Cast `value` to `AnyRef` based on the following:
https://github.com/apache/spark/pull/8799/files#diff-6cac9bc2656e3782b0312dceb8c55d47R132
https://github.com/apache/hive/blob/release-1.2.1/serde/src/java/org/apache/hadoop/hive/ql/io/sarg/SearchArgument.java#L255
Otherwise:
```
[error]
/Users/yumwang/spark/sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala:180:
type mismatch;
[error] found : Any
[error] required: Object
[error] Some(method.invoke(bd, attribute,
value).asInstanceOf[Builder].end())
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]