drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arina-ielchiieva <...@git.apache.org>
Subject [GitHub] drill pull request #819: DRILL-5419: Calculate return string length for lite...
Date Fri, 05 May 2017 12:30:53 GMT
Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/819#discussion_r113915317
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
---
    @@ -599,10 +598,28 @@ public LogicalExpression visitLiteral(RexLiteral literal) {
             throw new UnsupportedOperationException(String.format("Unable to convert the
value of %s and type %s to a Drill constant expression.", literal, literal.getType().getSqlTypeName()));
           }
         }
    -  }
     
    -  private static final TypedNullConstant createNullExpr(MinorType type) {
    -    return new TypedNullConstant(Types.optional(type));
    +    /**
    +     * Create nullable major type using given minor type
    +     * and wraps it in typed null constant.
    +     *
    +     * @param type minor type
    +     * @return typed null constant instance
    +     */
    +    private TypedNullConstant createNullExpr(MinorType type) {
    +      return new TypedNullConstant(Types.optional(type));
    +    }
    +
    +    /**
    +     * Create nullable varchar major type with given precision
    +     * and wraps it in typed null constant.
    +     *
    +     * @param precision precision value
    +     * @return typed null constant instance
    +     */
    +    private TypedNullConstant createStringNullExpr(int precision) {
    +      return new TypedNullConstant(Types.withPrecision(MinorType.VARCHAR, TypeProtos.DataMode.OPTIONAL,
precision));
    --- End diff --
    
    4. Expanded reply in previous comment.


---
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