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

James Taylor commented on PHOENIX-1872:
---------------------------------------

Ah, that explains why we didn't do it originally. I'd take a different approach 
than adding a BooleanCodec, as it's not a very good fit (as you've discovered). 
Instead, I'd make this method an instance method rather than static on 
PDataType:
{code}
  public static PhoenixArray instantiatePhoenixArray(PDataType actualType, 
Object[] elements) {
    return actualType.getArrayFactory().newArray(actualType, elements);
  }
{code}

Then you can define this as the default implementation, but do something 
different for PBoolean, either a boolean[] or a BitSet.

> Support PrimitiveBooleanPhoenixArray when creating PhoenixArray from Boolean[]
> ------------------------------------------------------------------------------
>
>                 Key: PHOENIX-1872
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1872
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Alex Warshavsky
>            Assignee: Alex Warshavsky
>            Priority: Minor
>              Labels: newbie
>
> Currently, when phoenix array is created from a boolean array, PhoenixArray 
> in instantiated instead of PrimitiveBooleanPhoenixArray.
> PArrayDataType.instantiatePhoenixArray(type, Boolean[] \{true, false});
> Other scalar/primitive types implement PhoenixArrayFactory to take advantage 
> of primitive arrays. E.g. 
> PArrayDataType.instantiatePhoenixArray(type, Integer[] \{1,2});
> returns PrimitiveIntPhoenixArray.



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

Reply via email to