[ 
https://issues.apache.org/jira/browse/SPARK-8436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15557282#comment-15557282
 ] 

Xiao Li commented on SPARK-8436:
--------------------------------

After reading the PR description, this is not valid now. 

> 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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to