You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Danny Dvinov (JIRA)" <ji...@apache.org> on 2017/05/10 05:40:04 UTC

[jira] [Created] (PHOENIX-3844) "Unsupported literal value" when using ANY with a nested query selecting an array

Danny Dvinov created PHOENIX-3844:
-------------------------------------

             Summary: "Unsupported literal value" when using ANY with a nested query selecting an array
                 Key: PHOENIX-3844
                 URL: https://issues.apache.org/jira/browse/PHOENIX-3844
             Project: Phoenix
          Issue Type: Bug
         Environment: Java, MacOS, Squirrel
            Reporter: Danny Dvinov
             Fix For: 4.10.0


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.






--
This message was sent by Atlassian JIRA
(v6.3.15#6346)