drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinfengni <...@git.apache.org>
Subject [GitHub] drill pull request #686: DRILL-5117: Compile error when query a json file wi...
Date Tue, 13 Dec 2016 23:39:43 GMT
Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/686#discussion_r92290434
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/SizedJBlock.java ---
    @@ -32,7 +32,11 @@
     
       public SizedJBlock(JBlock block) {
         this.block = block;
    -    this.count = 0;
    +    // count should be 1 because in some cases it is hard to increase it when
    +    // Logical Expressions are added to JBlock.
    +    // To avoid taking into account of some extra count from empty JBlock,
    --- End diff --
    
    I spent some time to understand why modifying this count makes the query compilation works.
 
    
    The failing case encounter compilation failure in Copier (for SVR operator). Turns out
that the idea of SizedJBlock (DRILL-4715) only works when we call ClassGenerator.addExpr().
This is fine with Project, Filter, Aggregator, etc, but not for Copier.  The Copier is doing
kind of short-cut handling, by accessing the eval() and setup() directly [1].
    
    Ideally, we probably should try to see if we can convert Copier using same mechanism in
Project/Filter. After some thoughts, I realized doing that might add additional overhead,
as the current way is doing the copying directly. 
    
    Given that, I'm fine with this proposed change. Please add comments to explain why we
set count = 1. 
    
    [1] https://github.com/apache/drill/blob/master/exec/java-exec/src/main/java/org/apache/drill/exec/vector/CopyUtil.java#L45-L50
 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message