Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16308#discussion_r97338806
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala ---
    @@ -103,6 +153,51 @@ class DateFunctionsSuite extends QueryTest with 
SharedSQLContext {
           Row("2015", "2015", "2013"))
       }
     
    +  test("date format with session local timezone") {
    +    val df = Seq((d, sdf.format(d), ts)).toDF("a", "b", "c")
    +
    +    // The child of date_format is implicitly casted to TimestampType with 
session local timezone.
    +    //
    +    // +---+---------------------+-------------+---------------------+
    +    // |   | df                  | timestamp   | date_format         |
    +    // +---+---------------------+-------------+---------------------+
    +    // | a |                16533|1428476400000|"2015-04-08 00:00:00"|
    +    // | b |"2015-04-08 13:10:15"|1428523815000|"2015-04-08 13:10:15"|
    --- End diff --
    
    I'm a little confused, the `d` is already a `Date`, how can we have the 
time info back after converting the date to string?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to