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

Implement SUBSTRING function for BINARY and VARBINARY

    Details

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

      Description

      Calling SUBSTRING(binary FROM int) and SUBSTRING(binary FROM int FOR int) is failing. While failing it complains that there're no matching SqlFunctions.substring(ByteString, int) and SqlFunctions.substring(ByteString, int, int).

      Could be simple fix.

        Issue Links

          Activity

          Hide
          kabhwan Jungtaek Lim added a comment -

          I've submitted quick fix: https://github.com/apache/calcite/pull/298

          Could anyone take a look at?

          Show
          kabhwan Jungtaek Lim added a comment - I've submitted quick fix: https://github.com/apache/calcite/pull/298 Could anyone take a look at?
          Hide
          julianhyde Julian Hyde added a comment -

          Looks good. However, can you also add an end-to-end test? SqlOperatorBaseTest.testSubstringFunction would be a good place. Let me know when you've updated the patch.

          Show
          julianhyde Julian Hyde added a comment - Looks good. However, can you also add an end-to-end test? SqlOperatorBaseTest.testSubstringFunction would be a good place. Let me know when you've updated the patch.
          Hide
          kabhwan Jungtaek Lim added a comment -

          Thanks Julian Hyde. Added binary version of substring tests based on simply copying and modifying string version of tests. Please have a look again.

          Show
          kabhwan Jungtaek Lim added a comment - Thanks Julian Hyde . Added binary version of substring tests based on simply copying and modifying string version of tests. Please have a look again.
          Hide
          julianhyde Julian Hyde added a comment -

          +1 Looks good. I will commit after 1.10 is released.

          Show
          julianhyde Julian Hyde added a comment - +1 Looks good. I will commit after 1.10 is released.
          Hide
          julianhyde Julian Hyde added a comment -
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/5cfe4e18 . Thanks for the PR, Jungtaek Lim !
          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.11.0 (2017-01-11).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.11.0 (2017-01-11).

            People

            • Assignee:
              kabhwan Jungtaek Lim
              Reporter:
              kabhwan Jungtaek Lim
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development