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

ASF GitHub Bot commented on TAJO-1659:
--------------------------------------

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

    https://github.com/apache/tajo/pull/612#discussion_r33147147
  
    --- Diff: 
tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/SeqScanExec.java
 ---
    @@ -228,26 +237,15 @@ public Tuple next() throws IOException {
           return null;
         }
     
    -    Tuple tuple;
    -    Tuple outTuple = new VTuple(outColumnNum);
    -
    -    if (!plan.hasQual()) {
    -      if ((tuple = scanner.next()) != null) {
    -        projector.eval(tuple, outTuple);
    -        outTuple.setOffset(tuple.getOffset());
    -        return outTuple;
    -      } else {
    -        return null;
    -      }
    -    } else {
    -      while ((tuple = scanner.next()) != null) {
    -        if (qual.eval(tuple).isTrue()) {
    -          projector.eval(tuple, outTuple);
    -          return outTuple;
    -        }
    -      }
    -      return null;
    +    while(scanIt.hasNext()) {
    +      Tuple outTuple = new VTuple(outColumnNum);
    --- End diff --
    
    outTuple don't have to be created for every input row.


> Simplify scan iteration in SeqScan
> ----------------------------------
>
>                 Key: TAJO-1659
>                 URL: https://issues.apache.org/jira/browse/TAJO-1659
>             Project: Tajo
>          Issue Type: Improvement
>          Components: physical operator
>            Reporter: Hyunsik Choi
>            Assignee: Hyunsik Choi
>             Fix For: 0.11.0
>
>
> SeqScanExec internally uses if-condition branch to perform filter iteration 
> or full-scan iteration on a table. It is possible to cause branch 
> misprediction. Also, this approach makes code messy. This patch introduce an 
> scan iterator to simplify the if-condition branch.



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

Reply via email to