You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Le Minh Tu (JIRA)" <ji...@apache.org> on 2015/06/18 10:58:01 UTC

[jira] [Created] (SPARK-8436) Inconsistent behavior when converting a Timestamp column to Integer/Long and then convert back to Timestamp

Le Minh Tu created SPARK-8436:
---------------------------------

             Summary: Inconsistent behavior when converting a Timestamp column to Integer/Long and then convert back to Timestamp
                 Key: SPARK-8436
                 URL: https://issues.apache.org/jira/browse/SPARK-8436
             Project: Spark
          Issue Type: Improvement
          Components: SQL
            Reporter: Le Minh Tu
            Priority: Minor


I'm aware that when converting from Integer/LongType to Timestamp, the column's values should be in milliseconds. However, I was surprised when trying to do this `a.select(a['event_time'].astype(LongType()).astype(TimestampType())).first()` and got back a totally different datetime ('event_time' is initially a TimestampType). There must be some constraints in implementation that I'm not aware of but it would be nice if a double conversion like this returns the initial value as one might expect.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org