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

Pmod should not throw a divide by zero exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.2, 2.1.1, 2.2.0
    • None
    • SQL
    • None

    Description

      Pmod currently throws a divide by zero exception when the right input is 0. It should - like Divide or Remainder - probably return null.

      Here is a small reproducer:

      scala> sql("select pmod(id, 0) from range(10)").show
      17/08/03 22:36:43 ERROR Executor: Exception in task 0.0 in stage 3.0 (TID 3)
      java.lang.ArithmeticException: / by zero
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hvanhovell Herman van Hövell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: