Package org.apache.drill.common.exceptions

Examples of org.apache.drill.common.exceptions.ExpressionParsingException


  }
 
 
  public LogicalExpression createExpression(String functionName, ExpressionPosition ep, List<LogicalExpression> args){
    FunctionDefinition d = funcMap.get(functionName);
    if(d == null) throw new ExpressionParsingException(String.format("Unable to find function definition for function named '%s'", functionName));
    return d.newCall(args, ep);
  }
View Full Code Here


  private final NamedExpression[] selections;

  @JsonCreator
  public Project(@JsonProperty("projections") NamedExpression[] selections) {
    this.selections = selections;
    if(selections == null || selections.length == 0) throw new ExpressionParsingException("Project did not provide any projection selections.  At least one projection must be provided.");
    for (int i = 0; i < selections.length; i++) {
      PathSegment segment = selections[i].getRef().getRootSegment();
      CharSequence path = segment.getNameSegment().getPath();
      if (!segment.isNamed() || !path.equals("output"))
        throw new ExpressionParsingException(String.format(
            "Outputs for projections always have to start with named path of output. First segment was named '%s' or was named [%s]", path, segment.isNamed()));

    }
  }
View Full Code Here

    case BOOLEAN:
      return OptionValue.createBoolean(type, name, (Boolean) literal.getValue());

    }

    throw new ExpressionParsingException(String.format(
        "Drill doesn't support set option expressions with literals of type %s.", literal.getTypeName()));
  }
View Full Code Here

    }

    @Override
    public void extraValidate(OptionValue v) throws ExpressionParsingException {
      if (v.num_val > max || v.num_val < 0)
        throw new ExpressionParsingException(String.format("Option %s must be between %d and %d.", getOptionName(), 0,
            max));
    }
View Full Code Here

    }

    @Override
    public void extraValidate(OptionValue v) throws ExpressionParsingException {
      if (v.float_val > max || v.float_val < min)
        throw new ExpressionParsingException(String.format("Option %s must be between %d and %d.", getOptionName(), min,
            max));
    }
View Full Code Here

    }

    @Override
    public final void validate(OptionValue v) throws ExpressionParsingException {
      if (v.kind != kind)
        throw new ExpressionParsingException(String.format("Option %s must be of type %s but you tried to set to %s.",
            getOptionName(), kind.name(), v.kind.name()));
    }
View Full Code Here

    for (JoinRelType jt : JoinRelType.values()) {
      if (jt.name().equalsIgnoreCase(val)) {
        return jt;
      }
    }
    throw new ExpressionParsingException(String.format("Unable to determine join type for value '%s'.", val));
  }
View Full Code Here

  @JsonCreator
  public Project(@JsonProperty("projections") NamedExpression[] selections) {
    this.selections = selections;
    if (selections == null || selections.length == 0) {
      throw new ExpressionParsingException(
          "Project did not provide any projection selections.  At least one projection must be provided.");
//    for (int i = 0; i < selections.length; i++) {
//      PathSegment segment = selections[i].getRef().getRootSegment();
//      CharSequence path = segment.getNameSegment().getPath();
//      if (!segment.isNamed() || !path.equals("output"))
View Full Code Here

    case BOOLEAN:
      return OptionValue.createBoolean(type, name, (Boolean) literal.getValue());

    }

    throw new ExpressionParsingException(String.format(
        "Drill doesn't support set option expressions with literals of type %s.", literal.getTypeName()));
  }
View Full Code Here

    @Override
    public void validate(OptionValue v) throws ExpressionParsingException {
      super.validate(v);
      if (v.num_val > max || v.num_val < 0) {
        throw new ExpressionParsingException(String.format("Option %s must be between %d and %d.", getOptionName(), 0,
            max));
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.drill.common.exceptions.ExpressionParsingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.