Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1288

Selecting more than 2 array elements via index fails with ArrayIndexOutOfBoundsException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0, 4.1.0
    • Fix Version/s: 4.2.0, 3.2.0
    • Labels:
      None

      Description

      Selecting more than two individual array elements in a query results in an ArrayIndexOutOfBoundsException thrown from ScanRegionObserver.

      An example of a query that will trigger this situation is as follows:

      select arr[1], arr[2], arr[3] from table_with_array

      The cause appears to be the replaceArrayIndexElement method in ScanRegionObserver. It removes a Cell for each array reference in the query, with the intention of replacing them with a reduced Cell that only contains the requested values of the array. The current impl attempts to remove the same KeyValue multiple times, and in the end attempts to remove more KeyValues than there are in the original list.

        Attachments

        1. PHOENIX-1288.patch
          24 kB
          Gabriel Reid

          Activity

            People

            • Assignee:
              gabriel.reid Gabriel Reid
              Reporter:
              gabriel.reid Gabriel Reid
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: