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/16 02:19:47 UTC

[GitHub] [spark] wangyum opened a new pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

wangyum opened a new pull request #30383:
URL: https://github.com/apache/spark/pull/30383


   ### What changes were proposed in this pull request?
   
   This pr add support Hive partition pruning on `Contains`, `StartsWith` and `EndsWith` predicate.
   
   
   ### Why are the changes needed?
   
   Improve query performance.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   
   ### How was this patch tested?
   
   Unit test.
   


----------------------------------------------------------------
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


[GitHub] [spark] SparkQA removed a comment on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727695118


   **[Test build #131123 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131123/testReport)** for PR 30383 at commit [`9c40971`](https://github.com/apache/spark/commit/9c40971afc3f4872232e518bd528900f5effd858).


----------------------------------------------------------------
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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727716457






----------------------------------------------------------------
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


[GitHub] [spark] wangyum commented on a change in pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
wangyum commented on a change in pull request #30383:
URL: https://github.com/apache/spark/pull/30383#discussion_r525742543



##########
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:
       It should have been tested from Hive 0.13 to Hive 3.1: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131123/testReport/org.apache.spark.sql.hive.client/HivePartitionFilteringSuite/




----------------------------------------------------------------
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


[GitHub] [spark] AmplabJenkins commented on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727727929






----------------------------------------------------------------
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


[GitHub] [spark] SparkQA commented on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727710880


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35726/
   


----------------------------------------------------------------
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


[GitHub] [spark] gatorsmile commented on a change in pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [spark] cloud-fan commented on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727786769


   thanks, merging to master!


----------------------------------------------------------------
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


[GitHub] [spark] cloud-fan closed pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #30383:
URL: https://github.com/apache/spark/pull/30383


   


----------------------------------------------------------------
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


[GitHub] [spark] AmplabJenkins commented on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727716457






----------------------------------------------------------------
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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727727929






----------------------------------------------------------------
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


[GitHub] [spark] SparkQA commented on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727695118


   **[Test build #131123 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131123/testReport)** for PR 30383 at commit [`9c40971`](https://github.com/apache/spark/commit/9c40971afc3f4872232e518bd528900f5effd858).


----------------------------------------------------------------
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


[GitHub] [spark] SparkQA commented on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727727586


   **[Test build #131123 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131123/testReport)** for PR 30383 at commit [`9c40971`](https://github.com/apache/spark/commit/9c40971afc3f4872232e518bd528900f5effd858).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
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


[GitHub] [spark] SparkQA commented on pull request #30383: [SPARK-33458][SQL] Hive partition pruning support Contains, StartsWith and EndsWith predicate

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30383:
URL: https://github.com/apache/spark/pull/30383#issuecomment-727716446


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35726/
   


----------------------------------------------------------------
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