Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/20067#discussion_r158725996 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala --- @@ -2760,6 +2760,17 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext { } } + test("SPARK-22894: DateTimeOperations should accept SQL like string type") { + val date = "2017-12-24" + val str = sql(s"SELECT CAST('$date' as STRING) + interval 2 months 2 seconds") + val dt = sql(s"SELECT CAST('$date' as DATE) + interval 2 months 2 seconds") + val ts = sql(s"SELECT CAST('$date' as TIMESTAMP) + interval 2 months 2 seconds") + + checkAnswer(str, Row("2018-02-24 00:00:02") :: Nil) + checkAnswer(dt, Row(Date.valueOf("2018-02-24")) :: Nil) + checkAnswer(ts, Row(Timestamp.valueOf("2018-02-24 00:00:02")) :: Nil) + } --- End diff -- Please get rid of this test case and merge them to https://github.com/apache/spark/pull/20061
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org