Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6622

Negative logarithms should return NaN or -Inf, not throw an IllegalArgumentException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.38.0
    • None
    • core
    • None

    Description

      Since |CALCITE-6312], log functions in SqlFunctions do throw an IllegalArgumentException, instead as an ArithmeticException as before.

      In terms of errors categorization, it is more precise to revert to the former behavior, as IllegalArgumentException is more suited to structural errors which do not depend on the actual values, whereas we would expect negative logarithms to throw the same kind of error as an integer division by zero for instance.

      An engine implementation could choose to have a different behaviors depending on the thrown errors, for instance to just abort the constants reduction for an illegal argument versus letting the arithmetic exception propagate to alert the user.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            cbrisson Claude Brisson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: