cloud-fan commented on a change in pull request #30535:
URL: https://github.com/apache/spark/pull/30535#discussion_r533965747



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/FiltersSuite.scala
##########
@@ -108,6 +108,21 @@ class FiltersSuite extends SparkFunSuite with Logging with 
PlanTest {
     (a("datecol", DateType) =!= Literal(Date.valueOf("2019-01-01"))) :: Nil,
     "datecol != 2019-01-01")
 
+  filterTest("string filter with date type",
+    (a("strcol", StringType).cast(DateType) > 
Literal(Date.valueOf("2019-01-01"))) :: Nil,
+    "strcol > 2019-01-01")

Review comment:
       is it really safe? Seems it assumes hive will also cast the string col 
to date and compare with the date literal.

##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/FiltersSuite.scala
##########
@@ -108,6 +108,21 @@ class FiltersSuite extends SparkFunSuite with Logging with 
PlanTest {
     (a("datecol", DateType) =!= Literal(Date.valueOf("2019-01-01"))) :: Nil,
     "datecol != 2019-01-01")
 
+  filterTest("string filter with date type",
+    (a("strcol", StringType).cast(DateType) > 
Literal(Date.valueOf("2019-01-01"))) :: Nil,
+    "strcol > 2019-01-01")

Review comment:
       is it really safe? Seems it assumes hive will also cast the string col 
to date and compare with the date literal.




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

Reply via email to