Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-26054

Creating a computed column applying the spark sql rounding on a column of type decimal affects the orginal column as well.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • 2.2.0
    • None
    • SQL
    • None

    Description

      When a computed column that rounds the value is added to a data frame, it is affecting the value of the original column as well. The behavior depends on the database column type - If it is either float or double, the result is as expected - the original column will have its own formatting and the computed column will be rounded as per the rounding definition specified for it. However if the column type in the database is decimal, then Spark SQL is applying the rounding even to the original column. Attached image has the spark sql code that shows the issue.

      Attachments

        1. sparksql-rounding.png
          98 kB
          Jaya Krishna

        Activity

          People

            Unassigned Unassigned
            ramanujak Jaya Krishna
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: