[
https://issues.apache.org/jira/browse/DRILL-5116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15806375#comment-15806375
]
ASF GitHub Bot commented on DRILL-5116:
---------------------------------------
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/716#discussion_r95046588
--- Diff: exec/java-exec/src/main/resources/drill-module.conf ---
@@ -167,10 +167,12 @@ drill.exec: {
debug: true,
janino_maxsize: 262144,
cache_max_size: 1000,
- // Enable to write generated source to disk. See ClassBuilder
- save_source: false,
// Where to save the generated source. See ClassBuilder
code_dir: "/tmp/drill/codegen"
--- End diff --
Writing to an external directory may require to add such source directory
to the IDE project each time when people try to debug the generated code.
One way I tried is to put the generated source under
$drill-java-exec/target/generated-sources, which is currently for freemarker's
generated source. That way, Intellij is able to load these new generated class
automatically when you debug.
The above approach requires us to exclude those runtime generated class
from the distribution jars, by adding the following in java-exec pom.xml.
```
<excludes>
<exclude>**/test/generated/**</exclude>
</excludes>
```
The above comment is optional.
> 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
> Labels: ready-to-commit
>
> 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.
> The advantages of this feature are two:
> 1. Ability to step through the generated code to increase understanding of
> existing operators and to ease development of improvements to existing
> operators and of any new operators we choose to create.
> 2. Open the door to experimenting with how to improve performance of the
> generated code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)