[ 
https://issues.apache.org/jira/browse/SPARK-8934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reynold Xin updated SPARK-8934:
-------------------------------
    Assignee: Yijie Shen

> cast from double/float to timestamp should not go through decimal
> -----------------------------------------------------------------
>
>                 Key: SPARK-8934
>                 URL: https://issues.apache.org/jira/browse/SPARK-8934
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Reynold Xin
>            Assignee: Yijie Shen
>
> We shouldn't convert the floating point number to decimal and then 
> immediately converting it into a timestamp.
> {code}
>     case DoubleType =>
>       buildCast[Double](_, d => try {
>         decimalToTimestamp(Decimal(d))
>       } catch {
>         case _: NumberFormatException => null
>       })
>     // TimestampWritable.floatToTimestamp
>     case FloatType =>
>       buildCast[Float](_, f => try {
>         decimalToTimestamp(Decimal(f))
>       } catch {
>         case _: NumberFormatException => null
>       })
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to