spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reynold Xin (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SPARK-8934) cast from double/float to timestamp should not go through decimal
Date Thu, 09 Jul 2015 01:11:04 GMT
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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message