Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/7216#discussion_r34184608
--- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala
---
@@ -99,6 +104,56 @@ private[hive] object HiveShim {
}
}
+ def toMetastoreFilter(
+ predicates: Seq[Expression],
+ partitionKeys: List[FieldSchema],
+ hiveMetastoreVersion: String): Option[String] = {
+
+ // Binary comparison has been supported in getPartitionsByFilter()
since Hive 0.13.
+ // So if Hive matastore version is older than 0.13, predicates cannot
be pushed down.
+ // See HIVE-4888.
+ val versionPattern = "([\\d]+\\.[\\d]+).*".r
+ hiveMetastoreVersion match {
--- End diff --
Instead of checking the version here, I'd see if we can't move this into
the [per version
HiveShim](https://github.com/apache/spark/blob/master/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala)
and just override it in the specific version classes, just so that we can be
consistent with all of the other version specific code.
---
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]