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

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

Good catch, [[email protected]]. We're missing this code from PBoolean:
{code}

    @Override
    public PhoenixArrayFactory getPhoenixArrayFactory() {
      return new PhoenixArrayFactory() {
        @Override
        public PhoenixArray newArray(PDataType type, Object[] elements) {
          return new PhoenixArray.PrimitiveBooleanPhoenixArray(type, elements);
        }
      };
    }
{code}

Further optimization would be to use a BitSet behind the scenes instead of a 
boolean[].

> 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
>            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