dongjoon-hyun commented on a change in pull request #32583:
URL: https://github.com/apache/spark/pull/32583#discussion_r735234256



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala
##########
@@ -577,6 +579,61 @@ class HivePartitionFilteringSuite(version: String)
       dateStrValue)
   }
 
+  test("getPartitionsByFilter: substr(chunk,0,1)=a") {
+    Seq("true" -> Seq("aa", "ab"), "false" -> chunkValue).foreach { t =>
+      withSQLConf(pruningFastFallback -> t._1) {
+        testMetastorePartitionFiltering(
+          Substring(attr("chunk"), Literal(0), Literal(1)) === "a",
+          dsValue,
+          hValue,
+          t._2,
+          dateValue,
+          dateStrValue)
+      }
+    }
+  }
+
+  test("getPartitionsByFilter: year(d)=2019") {
+    Seq("true" -> Seq("2019-01-01", "2019-01-02", "2019-01-03"),
+      "false" -> dateValue).foreach { t =>
+      withSQLConf(pruningFastFallback -> t._1) {
+        testMetastorePartitionFiltering(
+          Year(attr("d")) === 2019,
+          dsValue,
+          hValue,
+          chunkValue,
+          t._2,
+          dateStrValue)
+      }
+    }
+  }
+
+  test("getPartitionsByFilter: datestr=concat(2020-,01-,01)") {
+    Seq("true" -> Seq("2020-01-01"), "false" -> dateStrValue).foreach { t =>
+      withSQLConf(pruningFastFallback -> t._1) {
+        testMetastorePartitionFiltering(
+          attr("datestr") === Concat(Seq("2020-", "01-", "01")),
+          dsValue,
+          hValue,
+          chunkValue,
+          dateValue,
+          t._2)
+      }
+    }
+  }
+
+  test(s"getPartitionsByFilter: ds=20170101 when $fallbackKey=true") {
+    withSQLConf(fallbackKey -> "true",
+      pruningFastFallback -> "true") {

Review comment:
       nit. Shall we make this one liner?
   ```scala
   -    withSQLConf(fallbackKey -> "true",
   -      pruningFastFallback -> "true") {
   +    withSQLConf(fallbackKey -> "true", pruningFastFallback -> "true") {
   ```
   




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to