You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/03/19 19:53:42 UTC

[jira] [Commented] (DRILL-5356) Refactor Parquet Record Reader

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

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

GitHub user paul-rogers opened a pull request:

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

    DRILL-5356: Refactor Parquet Record Reader

    The Parquet reader is Drill's premier data source and has worked very well
    for many years. As with any piece of code, it has grown in complexity over
    that time and has become hard to understand and maintain.
    
    In work in another project, we found that Parquet is accidentally creating
    "low density" batches: record batches with little actual data compared to
    the amount of memory allocated. We'd like to fix that.
    
    However, the current complexity of the reader code creates a barrier to
    making improvements: the code is so complex that it is often better to
    leave bugs unfixed, or risk spending large amounts of time struggling to
    make small changes.
    
    This commit offers to help revitalize the Parquet reader. Functionality is
    identical to the code in master; but code has been pulled apart into
    various classes each of which focuses on one part of the task: building
    up a schema, keeping track of read state, a strategy for reading various
    combinations of records, etc. The idea is that it is easier to understand
    several small, focused classes than one huge, complex class. Indeed, the
    idea of small, focused classes is common in the industry; it is nothing new.
    
    Unit tests pass with the change. Since no logic has chanaged, we only moved
    lines of code, that is a good indication that everything still works.

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

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

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

    https://github.com/apache/drill/pull/789.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 #789
    
----
commit f54fc657ef4bda5db2743032ab64b504183f93c8
Author: Paul Rogers <pr...@maprtech.com>
Date:   2017-03-15T20:49:07Z

    DRILL-5356: Refactor Parquet Record Reader
    
    The Parquet reader is Drill's premier data source and has worked very well
    for many years. As with any piece of code, it has grown in complexity over
    that time and has become hard to understand and maintain.
    
    In work in another project, we found that Parquet is accidentally creating
    "low density" batches: record batches with little actual data compared to
    the amount of memory allocated. We'd like to fix that.
    
    However, the current complexity of the reader code creates a barrier to
    making improvements: the code is so complex that it is often better to
    leave bugs unfixed, or risk spending large amounts of time struggling to
    make small changes.
    
    This commit offers to help revitalize the Parquet reader. Functionality is
    identical to the code in master; but code has been pulled apart into
    various classes each of which focuses on one part of the task: building
    up a schema, keeping track of read state, a strategy for reading various
    combinations of records, etc. The idea is that it is easier to understand
    several small, focused classes than one huge, complex class. Indeed, the
    idea of small, focused classes is common in the industry; it is nothing new.
    
    Unit tests pass with the change. Since no logic has chanaged, we only moved
    lines of code, that is a good indication that everything still works.

----


> Refactor Parquet Record Reader
> ------------------------------
>
>                 Key: DRILL-5356
>                 URL: https://issues.apache.org/jira/browse/DRILL-5356
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.10.0, 1.11.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>             Fix For: 1.11.0
>
>
> The Parquet record reader class is a key part of Drill that has evolved over time to become somewhat hard to follow.
> A number of us are working on Parquet-related tasks and find we have to spend an uncomfortable amount of time trying to understand the code. In particular, this writer needs to figure out how to convince the reader to provide higher-density record batches.
> Rather than continue to decypher the complex code multiple times, this ticket requests to refactor the code to make it functionally identical, but structurally cleaner. The result will be faster time to value when working with this code.
> This is a lower-priority change and will be coordinated with others working on this code base. This ticket is only for the record reader class itself; it does not include the various readers and writers that Parquet uses since another project is actively modifying those classes.



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