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

ASF subversion and git services commented on IMPALA-7808:
---------------------------------------------------------

Commit c7ef48e1ddd1489221a11fe472a72289a6ef3d47 in impala's branch 
refs/heads/master from [~paul-rogers]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=c7ef48e ]

IMPALA-7808: Refactor Analyzer for easier debugging

Changes two blocks of code to make debugging easier. No functional
changes occur; changes are pure refactoring. A trivial change in
AnalyzerContext removes a nested conditional clause.

A larger change in SelectStmt takes the large analysis function and
breaks it into a series of smaller functions. The functions were large
because they shared state: variables created near the top are used much
later near the bottom.

To solve this, moved the code into an "algorithm" class whose only job
is to hold onto the temporary state so that the big function can be
broken into smaller pieces, with the temporary class fields used in
place of the former local variables.

For the most part, the existign code was simply split into functions
and indented.  One block of code had to be moved below the inner class
since it is not part of the analysis process.

Testing: No functional change, changes are purely structure.
Reran all tests, which passed.

Change-Id: I576c80c4c7a974df226fc91d8903db275069ed52
Reviewed-on: http://gerrit.cloudera.org:8080/11883
Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


> Refactor Analyzer for easier debugging
> --------------------------------------
>
>                 Key: IMPALA-7808
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7808
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Frontend
>    Affects Versions: Impala 3.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>
> The analysis steps in {{SelectStmt}} and {{AnalysisContext}} are large and 
> cumbersome. There is ample evidence in the literature that simpler, smaller 
> functions are easier to understand and debug than larger, more complex 
> functions. This ticket requests breaking up the large functions in these two 
> cases into smaller, easier-understood units in preparation for tracking down 
> issues related to missing rewrites of the {{WHERE}} and {{GROUP BY}} clauses.
> One might argue that large functions perform better by eliminating 
> unnecessary function calls. However, the planner is not performance 
> sensitive, and the dozen extra calls that this change introduce will not 
> change performance given the thousands of calls already made.
> Experience has shown that the JIT compiler in the JVM actually does a better 
> job optimizing smaller functions, and gives up when functions get to large. 
> So, by creating smaller functions, we may actually allow the JIT compiler to 
> generate better code.
> And, this refactoring is in support of a possible outcome that the planner 
> can handle rewrites without making multiple passes through the analyzer: that 
> savings will far outweigh the few extra calls this change introduces.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to