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

Liya Fan closed ARROW-6420.
---------------------------
    Resolution: Later

> [Java] Improve the performance of UnionVector when getting underlying vectors
> -----------------------------------------------------------------------------
>
>                 Key: ARROW-6420
>                 URL: https://issues.apache.org/jira/browse/ARROW-6420
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Liya Fan
>            Assignee: Liya Fan
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> Getting the underlying vector is a frequent opertation for UnionVector. It 
> relies on this operation to get/set data at each index.
> The current implementation is inefficient. In particular, it first gets the 
> minor type at the given index, and then compares it against all possible 
> minor types in a switch statment, until a match is found.
> We improve the performance by storing the internal vectors in an array, whose 
> index is the ordinal of the minor type. So given a minor type, its 
> corresponding underlying vector can be obtained in O(1) time.
> It should be noted that this technique is also applicable to UnionReader and 
> UnionWriter, and support for UnionReader is already implemented.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to