Package org.apache.drill.common.exceptions

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


        if (args.size() != 3) {
            StringBuilder err = new StringBuilder();
            for (int i = 0; i < args.size(); i++) {
                err.append("arg" + i + ": " + args.get(i).getMajorType().getMinorType());
            }
            throw new DrillRuntimeException("Decimal cast function invoked with incorect arguments" + err);
        }

        int scale = (int) ((ValueExpressions.LongExpression)(args.get(args.size() - 1))).getLong();
        int precision = (int) ((ValueExpressions.LongExpression)(args.get(args.size() - 2))).getLong();
        return (TypeProtos.MajorType.newBuilder().setMinorType(returnValue.type.getMinorType()).setScale(scale).setPrecision(precision).setMode(mode).build());
View Full Code Here


    } else if ((firstByte & 0xF0) == 0xE0) { // 3-byte char. First byte is 1110xxxx
      return 3;
    } else if ((firstByte & 0xF8) == 0xF0) { //4-byte char. First byte is 11110xxx
      return 4;
    }
    throw new DrillRuntimeException("Unexpected byte 0x" + Integer.toString((int)firstByte & 0xff, 16)
        + " at position " + idx + " encountered while decoding UTF8 string.");
  }
View Full Code Here

        return 3;
    }
    else if ((currentByte & 0xF8) == 0xF0){    //4-byte char. First byte is 11110xxx
        return 4;
    }
    throw new DrillRuntimeException("Unexpected byte 0x" + Integer.toString((int)currentByte & 0xff, 16) + " encountered while decoding UTF8 string.");
  }
View Full Code Here

        // finally register schemas with the refreshed plugins
        for (StoragePlugin plugin : plugins.values()) {
          plugin.registerSchemas(session, parent);
        }
      } catch (ExecutionSetupException e) {
        throw new DrillRuntimeException("Failure while updating storage plugins", e);
      }

      // Add second level schema as top level schema with name qualified with parent schema name
      // Ex: "dfs" schema has "default" and "tmp" as sub schemas. Add following extra schemas "dfs.default" and
      // "dfs.tmp" under root schema.
View Full Code Here

        continue;
      } else if(isCastable(result, next) && nextPrec >= resultPrec) {
        result = next;
        resultPrec = nextPrec;
      } else {
        throw new DrillRuntimeException("Case expression branches have different output types ");
      }
    }

    return result;
  }
View Full Code Here

    this.query = query;
    this.queryId = QueryIdHelper.getQueryId(id);
    try {
      this.profileCache = provider.getPStore(QUERY_PROFILE);
    } catch (IOException e) {
      throw new DrillRuntimeException(e);
    }
    this.foreman = foreman;
  }
View Full Code Here

        case NO_MORE:
          break outside;

        case WRITE_FAILED:
          if (i == 0) {
            throw new DrillRuntimeException("Record is too big to fit into allocated ValueVector");
          }
          break outside;
        };
      }


      writer.setValueCount(i);
      return i;

    }catch(IOException e){
      throw new DrillRuntimeException("Failure while reading JSON file.", e);
    }

  }
View Full Code Here

        this.groupScan = (GroupScan) getCopy(this.drillTable.getGroupScan()) ;
      } else {
        this.groupScan = this.drillTable.getGroupScan().clone(columns);
      }
    } catch (IOException e) {
      throw new DrillRuntimeException("Failure creating scan.", e);
    }

  }
View Full Code Here

  private static GroupScan getCopy(GroupScan scan){
    try {
      return (GroupScan) scan.getNewWithChildren((List<PhysicalOperator>) (Object) Collections.emptyList());
    } catch (ExecutionSetupException e) {
      throw new DrillRuntimeException("Unexpected failure while coping node.", e);
    }
  }
View Full Code Here

  private static GroupScan getCopy(GroupScan scan){
    try {
      return (GroupScan) scan.getNewWithChildren((List<PhysicalOperator>) (Object) Collections.emptyList());
    } catch (ExecutionSetupException e) {
      throw new DrillRuntimeException("Unexpected failure while coping node.", e);
    }
  }
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.