Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5424

Fix IOBE for reverse function

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.0
    • Fix Version/s: 1.11.0
    • Component/s: Functions - Drill
    • Labels:
      None

      Description

      Query with reverse function fails:

      0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test.json`;
      Error: SYSTEM ERROR: IndexOutOfBoundsException: index: 259, length: 1 (expected: range(0, 256))
      

      for table with several long varchars.

      cat /tmp/test.json
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      

      The same query works for the table with less row number:

      0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test2.json`;
      +-------------------------------------------------------+
      |                        EXPR$0                         |
      +-------------------------------------------------------+
      | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba  |
      | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba  |
      | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba  |
      | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba  |
      +-------------------------------------------------------+
      
      cat /tmp/test2.json
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vvysotskyi Volodymyr Vysotskyi
                Reporter:
                vvysotskyi Volodymyr Vysotskyi
                Reviewer:
                Arina Ielchiieva
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: