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

Exception-handling in built-in functions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      The standard calls for certain built-in functions to throw exceptions.

      Examples:

      • 1 / 0
      • MOD(1, 0)
      • OVERLAY('foo' PLACING 'x' FROM -1)
      • 'x' NOT LIKE 'x' ESCAPE 'x'

      First, these exceptions should occur at run time. They should cause the current value to become null, or the row to be omitted, but should not abort the query. (Actual behavior TBD.)

      Second, EnumerableCalc does constant reduction and generates code like 'static final int X = 0 / 0'. This code blows up when the class is loaded. It should not. The code should give errors for each row, as described above.

      While fixing this bug, see SqlOperatorBaseTest.testArgumentBounds and remove restrictions related to /, MOD and OVERLAY, LIKE.

      Attachments

        Issue Links

          Activity

            People

              zhztheplayer Hongze Zhang
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m