cloud-fan commented on a change in pull request #30408:
URL: https://github.com/apache/spark/pull/30408#discussion_r528772962
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/FiltersSuite.scala
##########
@@ -63,6 +64,24 @@ class FiltersSuite extends SparkFunSuite with Logging with
PlanTest {
(Literal(1) === a("intcol", IntegerType)) :: (Literal("a") === a("strcol",
IntegerType)) :: Nil,
"1 = intcol and \"a\" = strcol")
+ filterTest("date filter",
+ (a("datecol", DateType) === Literal(Date.valueOf("2019-01-01"))) :: Nil,
+ "datecol = 2019-01-01")
+
+ filterTest("date filter with IN predicate",
+ (a("datecol", DateType) in
+ (Literal(Date.valueOf("2019-01-01")),
Literal(Date.valueOf("2019-01-07")))) :: Nil,
+ "(datecol = 2019-01-01 or datecol = 2019-01-07)")
+
+ filterTest("date and string filter",
+ (Literal(Date.valueOf("2019-01-01")) === a("datecol", DateType)) ::
+ (Literal("a") === a("strcol", IntegerType)) :: Nil,
+ "2019-01-01 = datecol and \"a\" = strcol")
+
+ filterTest("date filter with null",
+ (a("datecol", DateType) === Literal(null)) :: Nil,
Review comment:
not related to this PR, but we can pushdown `col is null` predicate to
hive for this case.
----------------------------------------------------------------
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]