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

Paul Rogers commented on DRILL-5116:
------------------------------------

One final issue was found in the {{StreamingAggBatch}}: the use of the obscure 
{{\_\_DRILL_INIT\_\_}} method. This method is generated for all classes, but 
only the streaming agg includes any content. In the streaming agg, it is clear 
that the method is meant to be a "shadow constructor":

{code}
    public void __DRILL_INIT__() throws SchemaChangeException
    {
         work0 = new BigIntHolder();
         work9 = new BigIntHolder();
     }
{code}

The easiest way to handle this code is to call it from a real constructor:

{code}
    public StreamingAggregatorGen1() {
        try {
            __DRILL_INIT__();
        } catch (SchemaChangeException e) {
            throw new UnsupportedOperationException(e);
        }
    }
{code}

The code generator for Plain-old Java was extended to generate the required 
constructor.

> Enable generated code debugging in each Drill operator
> ------------------------------------------------------
>
>                 Key: DRILL-5116
>                 URL: https://issues.apache.org/jira/browse/DRILL-5116
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.9.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>
> DRILL-5052 adds the ability to debug generated code. Some of the code 
> generated by Drill's operators has minor problems when compiled directly 
> using the new technique. These issues are ignore by the byte-code-merge 
> technique uses in production. This ticket asks to try the DRILL-5052 feature 
> in each operator, clean up any minor problems, and ensure each operator 
> generates code suitable for debugging. Use the new 
> {{CodeGenerator.plainOldJavaCapable()}} method to mark each generated class 
> as ready for "plain-old Java" code gen.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to