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

Revisit MakeDecimal behavior on overflow

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      As pointed out in https://github.com/apache/spark/pull/20350#issuecomment-505997469, in special cases of decimal aggregation we are using the `MakeDecimal` operator.

      This operator has a not well defined behavior in case of overflow, namely what it does currently is:

      • if codegen is enabled it returns null;
      • in interpreted mode it throws an `IllegalArgumentException`.

      So we should make his behavior uniform with other similar cases and in particular we should honor the value of the conf introduced in SPARK-23179 and behave accordingly, ie.:

      • returning null if the flag is true;
      • throw an `ArithmeticException` if the flag is false.

      Attachments

        Issue Links

          Activity

            People

              mgaido Marco Gaido
              mgaido Marco Gaido
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: