[
https://issues.apache.org/jira/browse/SPARK-8436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14704712#comment-14704712
]
Apache Spark commented on SPARK-8436:
-------------------------------------
User 'x1-' has created a pull request for this issue:
https://github.com/apache/spark/pull/8339
> 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: [email protected]
For additional commands, e-mail: [email protected]