Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3839#discussion_r22365769
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala 
---
    @@ -154,6 +155,33 @@ class SQLQuerySuite extends QueryTest with 
BeforeAndAfterAll {
           Nil)
       }
     
    +  test("support cast date data type") {
    +    checkAnswer(sql(
    +      "SELECT d from dates where d = cast('2011-01-11' as date)"),
    +      java.sql.Date.valueOf("2011-01-11"))
    +
    +    checkAnswer(sql(
    +      "SELECT d from dates where d = '2012-02-12'"),
    +      java.sql.Date.valueOf("2012-02-12")
    +    )
    +
    +    checkAnswer(sql(
    +      "SELECT d from dates where d > '2012-02-12' AND d < 
cast('2014-01-01' as date)"),
    +      java.sql.Date.valueOf("2013-03-13")
    +    )
    +
    +    checkAnswer(sql(
    +      "SELECT d from dates where d IN('2012-02-12', '2013-03-13')"),
    +      Seq(Seq(java.sql.Date.valueOf("2012-02-12")),
    --- End diff --
    
    This might be clearer as
    
    ```scala
    Row(java.sql.Date.valueOf("2012-02-12")) :: 
    Row(java.sql.Date.valueOf("2013-03-13")) :: Nil
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to