You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Thomas D'Silva (JIRA)" <ji...@apache.org> on 2019/01/08 01:24:00 UTC

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

     [ https://issues.apache.org/jira/browse/PHOENIX-3844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas D'Silva updated PHOENIX-3844:
------------------------------------
    Fix Version/s:     (was: 4.15.0)

> "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
>            Priority: Major
>              Labels: array, nested
>
> 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
(v7.6.3#76005)