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

Bryan Cutler updated ARROW-1361:
--------------------------------
    Description: 
Vector classes contain private copies of each param in the {{ArrowType}}, but 
does not have any public api to access them.  So if given a vector you would 
have to get the {{Field}} from the and cast to the correct type.  For example, 
with a {{TimeStampMicroTZVector}} and trying to get the timezone:

{noformat}
if field.getType.isInstanceOf[ArrowType.Timestamp] &&
          field.getType.asInstanceOf[ArrowType.Timestamp].getTimezone
{noformat}

It would be more convenient to have direct accessors for these type params for 
the vector types that have parameters:

* DecimalVector
* FixedSizeBinaryVector
* ListVector
* TimeStamps with timezones
* FixedSizedListVector
* Unions


  was:
A {{NullableValueVector}} creates private copies of each param in the minor 
type, but does not have any way public api to access them.  So if given a 
{{NullableValueVector}} you would have to use the {{Field}} and cast to the 
correct type.  For example, with a {{NullableTimeStampMicroTZVector}} and 
trying to get the timezone:

{noformat}
if field.getType.isInstanceOf[ArrowType.Timestamp] &&
          field.getType.asInstanceOf[ArrowType.Timestamp].getTimezone
{noformat}

It would be more convenient to have direct accessors for these type params.  
Also, it is possible to do some minor refactoring because 
{{NullableValueVectors}} does not use these type params, so there is no need to 
store them.  They already exist in the inner vector object and the Field type.



> [Java] Add accessors to get type parameters from vector classes
> ---------------------------------------------------------------
>
>                 Key: ARROW-1361
>                 URL: https://issues.apache.org/jira/browse/ARROW-1361
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Java - Vectors
>            Reporter: Bryan Cutler
>            Priority: Major
>              Labels: starter
>
> Vector classes contain private copies of each param in the {{ArrowType}}, but 
> does not have any public api to access them.  So if given a vector you would 
> have to get the {{Field}} from the and cast to the correct type.  For 
> example, with a {{TimeStampMicroTZVector}} and trying to get the timezone:
> {noformat}
> if field.getType.isInstanceOf[ArrowType.Timestamp] &&
>           field.getType.asInstanceOf[ArrowType.Timestamp].getTimezone
> {noformat}
> It would be more convenient to have direct accessors for these type params 
> for the vector types that have parameters:
> * DecimalVector
> * FixedSizeBinaryVector
> * ListVector
> * TimeStamps with timezones
> * FixedSizedListVector
> * Unions



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to