You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "ramkrishna.s.vasudevan (JIRA)" <ji...@apache.org> on 2014/03/11 08:28:44 UTC

[jira] [Updated] (PHOENIX-128) Support coercion and descending sort order for ARRAY

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

ramkrishna.s.vasudevan updated PHOENIX-128:
-------------------------------------------

    Attachment: Phoenix-128_1.patch

Regarding the coercion between types, there is one thing to note.  Suppose we create a Long[] and say use it as an Integer 
Long[] l = new Long[] {100l, 200l}
conn.createArrayOf("INTEGER",l );
This would not work because when we form the primitive array we would create an Integer array (int[]).  But I think this is right correct? Though the individual element is coercibleto Int the array as a whole is not. 
The current patch handles bit inversion for DESC and also makes necessary changes not to call toBytes in the coerceBytes flow once again if maxLength is null and if the sortOrders are same.

> Support coercion and descending sort order for ARRAY
> ----------------------------------------------------
>
>                 Key: PHOENIX-128
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-128
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 3.0.0
>
>         Attachments: Phoenix-128_1.patch
>
>
> Now that our ARRAY types may be used in the primary key, we need to support descending sort order (i.e. inverting the bits). There are also holes in the support for coerce, as it's legitimate to coerce an array of BIGINT to an array of INTEGER for example.
> This can all be handled pretty easily in the PArrayDataType.coerceBytes() method.



--
This message was sent by Atlassian JIRA
(v6.2#6252)