Package org.apache.drill.common.exceptions

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


    if (args.size() == 1) {
      return args.get(0);
    }

    if (args.size() - 1 != opTypes.size())
      throw new DrillRuntimeException("Must receive one more expression then the provided number of operators.");

    LogicalExpression first = args.get(0);
    for (int i = 0; i < opTypes.size(); i++) {
      List<LogicalExpression> l2 = new ArrayList<LogicalExpression>();
      l2.add(first);
View Full Code Here


  public NumericValue getAsNumeric() {
    return this;
  }

  public long getAsLong(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to a long.", this.getDataType()));
  }
View Full Code Here

  public long getAsLong(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to a long.", this.getDataType()));
  }
  public int getAsInt(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to an int.", this.getDataType()));
  }
View Full Code Here

  }
  public int getAsInt(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to an int.", this.getDataType()));
  }
  public float getAsFloat(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to an float.", this.getDataType()));
  }
View Full Code Here

  }
  public float getAsFloat(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to an float.", this.getDataType()));
  }
  public double getAsDouble(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to a double.", this.getDataType()));
  }
View Full Code Here

  }
  public double getAsDouble(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to a double.", this.getDataType()));
  }
  public BigDecimal getAsBigDecimal(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to an big decimal.", this.getDataType()));
  }
View Full Code Here

  }
  public BigDecimal getAsBigDecimal(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to an big decimal.", this.getDataType()));
  }
  public BigInteger getAsBigInteger(){
    throw new DrillRuntimeException(String.format("A %s value can not be implicitly cast to a big integer.", this.getDataType()));
  }
View Full Code Here

 
  public static boolean getBoolean(DataValue v){
    if(v.getDataType().getMinorType() == MinorType.BIT && v.getDataType().getMode() != DataMode.REPEATED){
      return v.getAsBooleanValue().getBoolean();
    }else{
      throw new DrillRuntimeException(String.format("Unable to get boolean.  Type was a %s", v.getClass().getCanonicalName()));
    }
  }
View Full Code Here

 
  public static long getLong(DataValue v){
    if(Types.isNumericType(v.getDataType())){
      return v.getAsNumeric().getAsLong();
    }else{
      throw new DrillRuntimeException(String.format("Unable to get value.  %s is not a numeric type.", v.getClass().getCanonicalName()));
    }
  }
View Full Code Here

  }
  public static double getDouble(DataValue v){
    if(Types.isNumericType(v.getDataType())){
      return v.getAsNumeric().getAsDouble();
    }else{
      throw new DrillRuntimeException(String.format("Unable to get value.  %s is not a numeric type.", v.getClass().getCanonicalName()));
    }
  }
View Full Code Here

TOP

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

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.