Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/716#discussion_r95459877
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/compile/CodeCompiler.java ---
    @@ -41,12 +39,87 @@
      */
     
     public class CodeCompiler {
    +  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(CodeCompiler.class);
    +
    +  /**
    +   * Abstracts out the details of compiling code using the two available
    +   * mechanisms. Allows this mechanism to be unit tested separately from
    +   * the code cache.
    +   */
    +
    +  public static class CodeGenCompiler {
    +    private final ClassTransformer transformer;
    +    private final ClassBuilder classBuilder;
    +
    +    public CodeGenCompiler(final DrillConfig config, final OptionManager 
optionManager) {
    +      transformer = new ClassTransformer(config, optionManager);
    +      classBuilder = new ClassBuilder(config, optionManager);
    +    }
    +
    +    /**
    +     * Compile the code already generated by the code generator.
    +     *
    +     * @param cg the code generator for the class
    +     * @return the compiled class
    +     * @throws Exception if anything goes wrong
    +     */
    +
    +    public Class<?> compile(final CodeGenerator<?> cg) throws Exception {
    +       if (cg.isPlainOldJava()) {
    --- End diff --
    
    Since we now have to modes for runtime code generation across almost all 
Drill operators (plain-old vs bytecode transformer), is there a way to check 
which mode is used for each operator in a query? It would be nice to include 
such information in log, to help analyze a potential issue (whether there is a 
bug in the bytecode transformer, or plain-old style class). 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to