Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-8829 Improve expression performance
  3. SPARK-8934

cast from double/float to timestamp should not go through decimal

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0
    • SQL
    • None

    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

          Activity

            People

              cloud_fan Wenchen Fan
              rxin Reynold Xin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: