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

ASF GitHub Bot commented on DRILL-5324:
---------------------------------------

GitHub user paul-rogers opened a pull request:

    https://github.com/apache/drill/pull/783

    DRILL-5324: Provide simplified column reader/writer for use in tests

    The new "sub-operator" unit test framework provides simple ways to create 
row sets in code. This PR includes the column accessor code:
    
    * Interfaces for column accessors
    * Template for generated implementations
    * Base implementation used by the generated code
    * Factory class to create the proper reader or writer given a major
    type (type and cardinality)
    * Utilities for generic access, type conversions, etc.
    
    Many vector types can be mapped to an int for get and set. One key
    exception are the decimal types: decimals, by definition, require a
    different representation. In Java, that is `BigDecimal`. Added get, set
    and setSafe accessors as required for each decimal type that uses
    `BigDecimal` to hold data.
    
    Work remains to be done on other complex types: intervals and so on.
    This will be added incrementally as work proceeds.
    
    The generated code builds on the `valueVectorTypes.tdd` file, adding
    additional properties needed to generate the accessors.
    
    The PR also includes a number of code cleanups done while reviewing
    existing code. In particular `DecimalUtility` was very roughly
    formatted and thus hard to follow.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/paul-rogers/drill DRILL-5324

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/783.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #783
    
----
commit eb0b8bc33aeea27fd0aae582d19297bd0bda92e1
Author: Paul Rogers <[email protected]>
Date:   2017-03-11T07:03:23Z

    The PR includes the column accessor code:
    
    * Interfaces described above
    * Generated implementations
    * Base implementation used by the generated code
    * Factory class to create the proper reader or writer given a major
    type (type and cardinality)
    * Utilities for generic access, type conversions, etc.
    
    Many vector types can be mapped to an int for get and set. One key
    exception are the decimal types: decimals, by definition, require a
    different representation. In Java, that is `BigDecimal`. Added get, set
    and setSafe accessors as required for each decimal type that uses
    `BigDecimal` to hold data.
    
    Work remains to be done on other complex types: intervals and so on.
    This will be added incrementally as work proceeds.
    
    The generated code builds on the `valueVectorTypes.tdd` file, adding
    additional properties needed to generate the accessors.
    
    The PR also includes a number of code cleanups done while reviewing
    existing code. In particular `DecimalUtility` was very roughly
    formatted and thus hard to follow.

----


> Provide simplified column reader/writer for use in tests
> --------------------------------------------------------
>
>                 Key: DRILL-5324
>                 URL: https://issues.apache.org/jira/browse/DRILL-5324
>             Project: Apache Drill
>          Issue Type: Sub-task
>          Components: Tools, Build & Test
>    Affects Versions: 1.11.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>             Fix For: 1.11.0
>
>
> In support of DRILL-5323, we wish to provide a very easy way to work with row 
> sets. See the comment section for examples of the target API.
> Drill provides over 100 different value vectors, any of which may be required 
> to perform a specific unit test. Creating these vectors, populating them, and 
> retrieving values, is very tedious. The work is so complex that it acts to 
> discourage developers from writing such tests.
> To simplify the task, we wish to provide a simplified row set reader and 
> writer. To do that, we need to generate the corresponding column reader and 
> writer for each value vector. This ticket focuses on the column-level readers 
> and writers, and the required code generation.
> Drill already provides vector readers and writers derived from 
> {{FieldReader}}. However, these readers do not provide a uniform get/set 
> interface that is type independent on the application side. Instead, 
> application code must be aware of the type of the vector, something we seek 
> to avoid for test code.
> The reader and writer classes are designed to be used in many contexts, not 
> just for testing. As a result, their implementation makes no assumptions 
> about the broader row reader and writer, other than that a row index and the 
> required value vector are both available. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to