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

"Unsupported literal value" when using ANY with a nested query selecting an array

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • Java, MacOS, Squirrel

    • Important

    Description

      Might be a syntax issue, but I'm following the " = ANY" example at https://phoenix.apache.org/array_type.html and getting "Unsupported literal value" error.

      My schema consists of two tables:
      Table ITEM_SETS has SET_ID and ITEM_IDS columns:
      SET_ID char(20) not null,
      STATUS tinyint,
      ITEM_IDS VARCHAR ARRAY

      Table ITEMS has ITEM_ID and SET_IDS columns:
      ITEM_ID char(15) not null,
      SET_IDS VARCHAR ARRAY

      Data for this example:

      ITEM_SETS:
      SET_ID, STATUS, ITEM_IDS
      set1, 0, ARRAY['item1', 'item4', 'item5']

      ITEMS:
      ITEM_ID, SET_IDS
      item1, ARRAY['set1']
      item4, ARRAY['set1']
      item5, ARRAY['set1']

      Issuing a query

      SELECT ITEM_ID, SET_IDS FROM ITEMS WHERE ITEM_ID =
      ANY (SELECT ITEM_IDS FROM ITEM_SETS WHERE STATUS = 0 ORDER BY ARRAY_LENGTH(ITEM_IDS) ASC LIMIT 1)

      results into "Unsupported literal value [[ARRAY['item1','item4','item5']]] of type org.apache.phoenix.schema.types.PhoenixArray"

      SELECT ITEM_ID, SET_IDS FROM ITEMS WHERE ITEM_ID =
      ANY(ARRAY['item1','item4','item5'])

      Returns
      item1, ARRAY['set1']
      item4, ARRAY['set1']
      item5, ARRAY['set1']

      as expected. Seeing this both from Squirrel 3.6 and using JDBC.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ddvinov Danny Dvinov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: