Reynold Xin created SPARK-8934:
----------------------------------
Summary: 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
Reporter: Reynold Xin
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]