You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by amansinha100 <gi...@git.apache.org> on 2018/03/01 07:33:23 UTC

[GitHub] drill pull request #1096: DRILL-6099 : Push limit past flatten(project) with...

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

    https://github.com/apache/drill/pull/1096#discussion_r171478085
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelOptUtil.java ---
    @@ -224,4 +226,64 @@ public Void visitInputRef(RexInputRef inputRef) {
         }
       }
     
    +  public static boolean isLimit0(RexNode fetch) {
    +    if (fetch != null && fetch.isA(SqlKind.LITERAL)) {
    +      RexLiteral l = (RexLiteral) fetch;
    +      switch (l.getTypeName()) {
    +        case BIGINT:
    +        case INTEGER:
    +        case DECIMAL:
    +          if (((long) l.getValue2()) == 0) {
    +            return true;
    +          }
    +      }
    +    }
    +    return false;
    +  }
    +
    +  public static boolean isProjectOutputRowcountUnknown(RelNode project) {
    --- End diff --
    
    Could you add javadoc for this utility function. 


---