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

Fix IOBE for reverse function

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.9.0
    • 1.11.0
    • Functions - Drill
    • 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

              volodymyr Vova Vysotskyi
              volodymyr Vova Vysotskyi
              Arina Ielchiieva Arina Ielchiieva
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: