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 2021/03/04 07:35:50 UTC

[GitHub] [spark] c21 commented on a change in pull request #31722: [SPARK-34595][SQL] DPP support RLIKE

c21 commented on a change in pull request #31722:
URL: https://github.com/apache/spark/pull/31722#discussion_r587217340



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala
##########
@@ -1403,6 +1403,32 @@ abstract class DynamicPartitionPruningSuiteBase
       )
     }
   }
+
+  test("SPARK-34436: DPP support RLike expression") {
+    withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true") {
+      val df = sql(
+        """
+          |SELECT date_id, product_id FROM fact_sk f
+          |JOIN dim_store s
+          |ON f.store_id = s.store_id WHERE s.country RLIKE  '[DE|US]'

Review comment:
       nit: extra unnecessary spaces between `RLIKE` and `'[DE...`

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala
##########
@@ -1403,6 +1403,32 @@ abstract class DynamicPartitionPruningSuiteBase
       )
     }
   }
+
+  test("SPARK-34436: DPP support RLike expression") {
+    withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true") {
+      val df = sql(
+        """
+          |SELECT date_id, product_id FROM fact_sk f
+          |JOIN dim_store s
+          |ON f.store_id = s.store_id WHERE s.country RLIKE  '[DE|US]'
+        """.stripMargin)
+
+      checkPartitionPruningPredicate(df, false, true)
+
+      checkAnswer(df,
+        Row(1030, 2) ::
+          Row(1040, 2) ::
+          Row(1050, 2) ::
+          Row(1060, 2) ::
+          Row(1070, 2) ::
+          Row(1080, 3) ::
+          Row(1090, 3) ::
+          Row(1100, 3) ::
+          Row(1110, 3) ::
+          Row(1120, 4) :: Nil

Review comment:
       nit: should be same indentation as other test cases in this file.




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