maropu commented on a change in pull request #31710:
URL: https://github.com/apache/spark/pull/31710#discussion_r585502010
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala
##########
@@ -18,7 +18,6 @@
package org.apache.spark.sql
import org.scalatest.GivenWhenThen
-
Review comment:
please revert this.
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala
##########
@@ -1403,6 +1402,52 @@ abstract class DynamicPartitionPruningSuiteBase
)
}
}
+
+ test("SPARK-34436: DPP support Like/RLike expression") {
+
+
Review comment:
please remove the two unnecessary blanks above.
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala
##########
@@ -1403,6 +1402,52 @@ abstract class DynamicPartitionPruningSuiteBase
)
}
}
+
+ test("SPARK-34436: DPP support Like/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 LIKE '%D%'
+ """.stripMargin)
+
+ checkPartitionPruningPredicate(df, false, true)
+
+ checkAnswer(df,
+ Row(1030, 2) ::
+ Row(1040, 2) ::
+ Row(1050, 2) ::
+ Row(1060, 2) :: Nil
+ )
+ }
+ 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)
+
+
Review comment:
nit: please remove the single blank above.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]