You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Josh Elser (JIRA)" <ji...@apache.org> on 2018/02/15 16:26:01 UTC

[jira] [Updated] (PHOENIX-4535) Index in array data type is inconsistent.

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

Josh Elser updated PHOENIX-4535:
--------------------------------
    Fix Version/s:     (was: 5.0)
                   5.1.0

> Index in array data type is inconsistent. 
> ------------------------------------------
>
>                 Key: PHOENIX-4535
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4535
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0, 4.13.0
>            Reporter: Romil Choksi
>            Priority: Major
>              Labels: HBase-2.0
>             Fix For: 5.1.0
>
>
> We allow using zero indexes for elements in array column and returns null by accident. 
> A simple test case to reproduce:
> {noformat}
>         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
>         Connection conn = DriverManager.getConnection(getUrl(), props);
>         conn.createStatement().execute("create table A(ID INTEGER PRIMARY KEY, array_id VARCHAR[])");
>         conn.createStatement().execute("upsert into A values (1, ARRAY['test','test2','test3'])");
>         conn.commit();
>         ResultSet rs = conn.createStatement().executeQuery("select array_id[0], array_id[1] from A");
>         while(rs.next()) {
>             System.out.println(rs.getString(1));
>             System.out.println(rs.getString(2));
>         }
> {noformat}
> The result for 4.x branches would be {null, 'test'} and it would fail with an exception for 5.x.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)