Description
We shouldn't convert the floating point number to decimal and then immediately converting it into a timestamp.
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 })
Attachments
Issue Links
- is duplicated by
-
SPARK-8942 use double not decimal when cast double and float to timestamp
- Resolved