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

ramkrishna.s.vasudevan commented on PHOENIX-128:
------------------------------------------------

{code}
    if (   ( Objects.equal(maxLength, desiredMaxLength) || maxLength == null )
         &&  actualType.isBytesComparableWith(desiredType)
         && actualModifer == expectedModifier) {
            return;
        }
{code}

I have added one more condition here
{code}
    if (   ( Objects.equal(maxLength, desiredMaxLength) || maxLength == null  
|| desiredMaxLength ==null)
         &&  actualType.isBytesComparableWith(desiredType)
         && actualModifer == expectedModifier) {
            return;
        }
{code}
Because for arrays of long, int etc we don't have desired max length and in 
that case also we need not call toBytes once agian unless there is a change in 
the modifier.  Also in the current patch added coerceBytes in other array types 
also, which if we don't add would call the default behaviour and the inversion 
may be wrong.

> 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, Phoenix-128_2.patch, 
> Phoenix-128_3.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)

Reply via email to