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

Add an extension operator table with Oracle-specific operators

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:

      Description

      Add a mechanism to allow connections to use additional operator tables, the first of which will be one with Oracle-specific functions. We don't aim to do every function.

      Important functions:

      • DECODE
      • NVL
      • RTRIM
      • LTRIM
      • LPAD
      • RPAD
      • TO_CHAR
      • TO_NUMBER
      • TO_DATE
      • TRUNC
      • SUBSTR (different from standard SUBSTRING)
      • INSTR

      Easy:

      • PI
      • DEGREES
      • RADIANS
      • SIGN
      • GREATEST
      • LEAST

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.7.0 (2016-03-22).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.7.0 (2016-03-22).
          Hide
          julianhyde Julian Hyde added a comment -

          Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/707e72d5. Functions added: DECODE, NVL, LTRIM, RTRIM, GREATEST, LEAST.

          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/707e72d5 . Functions added: DECODE, NVL, LTRIM, RTRIM, GREATEST, LEAST.
          Show
          julianhyde Julian Hyde added a comment - Also consider: REPLACE (see CALCITE-420 ) TRANSLATE (see https://mail-archives.apache.org/mod_mbox/calcite-dev/201602.mbox/%3CCAC1ju52F_MKNFbcPk0b-k9pmv7O%2Bhw6nENqDyk%3DSspTT_GJmnw%40mail.gmail.com%3E )
          Hide
          julianhyde Julian Hyde added a comment -

          The fix to CALCITE-1054 will make IS NOT DISTINCT FROM, and hence DECODE, more efficient.

          Show
          julianhyde Julian Hyde added a comment - The fix to CALCITE-1054 will make IS NOT DISTINCT FROM, and hence DECODE, more efficient.
          Hide
          julianhyde Julian Hyde added a comment -

          On my dev branch I have now implemented DECODE, NVL, LTRIM, RTRIM, GREATEST, LEAST.

          If folks would like to work on other functions, please pitch in!

          DECODE is a little inefficient because I use 'is not distinct from' for each searched value, to handle nulls correctly, and 'x is not distinct from y' translates to 'case when x is null then y is not null when y is null then x is not null else x = y end'. Maybe someone could work on simplifying that expression.

          Show
          julianhyde Julian Hyde added a comment - On my dev branch I have now implemented DECODE, NVL, LTRIM, RTRIM, GREATEST, LEAST. If folks would like to work on other functions, please pitch in! DECODE is a little inefficient because I use 'is not distinct from' for each searched value, to handle nulls correctly, and 'x is not distinct from y' translates to 'case when x is null then y is not null when y is null then x is not null else x = y end'. Maybe someone could work on simplifying that expression.

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development