[ 
https://issues.apache.org/jira/browse/PHOENIX-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14581536#comment-14581536
 ] 

Dumindu Buddhika commented on PHOENIX-2021:
-------------------------------------------

Thanks for the feedback [~ram_krish] :)
{quote}
The increase in length is always going to happen because of the nulls that are 
accountable in the first part of the 2nd array combined with the nulls at the 
end of the first array. Here for the nulls at the end of the first array is 
just not going to do any increase or change to the length increase due to nulls.
{quote}
Though we do not put bytes to indicate nulls at the end of the array(As only 
offsets are put to indicate trailing nulls of an array) , There can be nulls at 
the end of the first array right? So when they are added there can be a length 
increase to store total nulls in the middle.

{quote}
Seeing these complexities I would still think if we could copy the elements of 
both the arrays and just call the existing toBytes. As you said it may end up 
in creating multiple objects and mutiple serialization and deserialization 
operation.
{quote}
I also think this would be better in reducing the complexity. Also if we change 
the array serialization formats in future, we won't have to change the code 
according to them if we follow this approach. So do you think we should do it 
this way?

> Implement ARRAY_CAT built in function
> -------------------------------------
>
>                 Key: PHOENIX-2021
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2021
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Dumindu Buddhika
>            Assignee: Dumindu Buddhika
>         Attachments: PHOENIX-2021.patch
>
>
> Ex:
> ARRAY_CAT(ARRAY[2, 3, 4], ARRAY[4, 5, 6]) = ARRAY[2,3,4,4,5,6]
> ARRAY_CAT(ARRAY["a", "b"], ARRAY["c", "d"]) = ARRAY["a", "b", "c", "d"]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to