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

Revisit MakeDecimal behavior on overflow

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Component/s: SQL
    • Labels:
      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

          Activity

            People

            • Assignee:
              mgaido Marco Gaido
              Reporter:
              mgaido Marco Gaido

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment