You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/18 03:33:50 UTC
[GitHub] [spark] gatorsmile commented on a change in pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate
gatorsmile commented on a change in pull request #30383:
URL: https://github.com/apache/spark/pull/30383#discussion_r525737714
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala
##########
@@ -753,6 +753,15 @@ private[client] class Shim_v0_13 extends Shim_v0_12 {
ExtractableLiteral(value), ExtractAttribute(SupportedAttribute(name))) =>
Some(s"$value ${op.symbol} $name")
+ case Contains(ExtractAttribute(SupportedAttribute(name)), ExtractableLiteral(value)) =>
+ Some(s"$name like " + (("\".*" + value.drop(1)).dropRight(1) + ".*\""))
+
+ case StartsWith(ExtractAttribute(SupportedAttribute(name)), ExtractableLiteral(value)) =>
+ Some(s"$name like " + (value.dropRight(1) + ".*\""))
+
+ case EndsWith(ExtractAttribute(SupportedAttribute(name)), ExtractableLiteral(value)) =>
Review comment:
@wangyum Can we add test cases to ensure all the Hive metastore versions support them?
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org