Package org.apache.drill.common.exceptions

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


        call.transformTo(newScan);
      } else {
        call.transformTo(newProj);
      }
    } catch (IOException e) {
      throw new DrillRuntimeException(e);
    }
  }
View Full Code Here


      }
      // TODO - replace this with new functionality of returning batches even if no columns are selected
      // the query 'select 5 from parquetfile' should return the number of records that the parquet file contains
      // we don't need to read any of the data, we just need to fill batches with a record count and a useless vector with
      // the right number of values
      if (firstColumnStatus == null) throw new DrillRuntimeException("Unexpected error reading parquet file, not reading any columns");

      if (allFieldsFixedLength) {
        recordsToRead = Math.min(recordsPerBatch, firstColumnStatus.columnChunkMetaData.getValueCount() - firstColumnStatus.totalValuesRead);
      } else {
        recordsToRead = DEFAULT_RECORDS_TO_READ_IF_NOT_FIXED_WIDTH;

      }

      if (allFieldsFixedLength) {
        readAllFixedFields(recordsToRead);
      } else { // variable length columns
        long fixedRecordsToRead = varLengthReader.readFields(recordsToRead, firstColumnStatus);
        readAllFixedFields(fixedRecordsToRead);
      }

      return firstColumnStatus.getRecordsReadInCurrentPass();
    } catch (IOException e) {
      throw new DrillRuntimeException(e);
    }
  }
View Full Code Here

      vector.getMutator().setValueCount(recordCount);
      logger.debug("text scan batch size {}", batchSize);
      return recordCount;
    } catch (IOException e) {
      cleanup();
      throw new DrillRuntimeException(e);
    }
  }
View Full Code Here

          }
        }
        for (int id : columnIds) {
          boolean success = false; // setValue(primitiveCategories.get(id), vectors.get(id), recordCount, bytes, delimPositions[id]);
          if (!success) {
            throw new DrillRuntimeException(String.format("Failed to write value for column %s", selectedColumnNames.get(id)));
          }

        }
        redoRecord = null;
      }
      while (recordCount < TARGET_RECORD_COUNT && reader.next(key, value)) {
        int length = ((Text) value).getLength();
        byte[] bytes = ((Text) value).getBytes();
        int[] delimPositions = new int[numCols + 1];
        delimPositions[0] = -1;
        int p = 1;
        for (int i = 0; i < length; i++) {
          if (bytes[i] == delimiter) {
            delimPositions[p++] = i;
          }
        }
        for (int i = 0; i < columnIds.size(); i++) {
          int id = columnIds.get(i);
          boolean success = false; // setValue(primitiveCategories.get(i), vectors.get(i), recordCount, bytes, delimPositions[id] + 1);
          if (!success) {
            redoRecord = value;
            if (partition != null) populatePartitionVectors(recordCount);
            return recordCount;
          }
        }
        recordCount++;
      }
      if (partition != null) populatePartitionVectors(recordCount);
      return recordCount;
    } catch (IOException e) {
      throw new DrillRuntimeException(e);
    }
  }
View Full Code Here

      AvaticaStatement statement = connection.createStatement();
      statement.execute(s);
      return statement.getResultSet();

    }catch(Exception e){
      throw new DrillRuntimeException("Failure while attempting to get DatabaseMetadata.", e);
    }

  }
View Full Code Here

          leftOver = null;
        } else {
          result = resultScanner.next();
        }
      } catch (IOException e) {
        throw new DrillRuntimeException(e);
      }
      if (result == null) {
        break done;
      }
View Full Code Here

        getColumns().add(column);
        familyVectorMap.put(familyName, v);
      }
      return v;
    } catch (SchemaChangeException e) {
      throw new DrillRuntimeException(e);
    }
  }
View Full Code Here

    try {
      Get get = new Get(row(key));
      get.addColumn(FAMILY, QUALIFIER);
      return value(table.get(get));
    } catch (IOException e) {
      throw new DrillRuntimeException("Caught error while getting row '" + key + "' from for table:" + Bytes.toString(table.getTableName()), e);
    }
  }
View Full Code Here

    try {
      Put put = new Put(row(key));
      put.add(FAMILY, QUALIFIER, bytes(value));
      table.put(put);
    } catch (IOException e) {
      throw new DrillRuntimeException("Caught error while putting row '" + key + "' from for table:" + Bytes.toString(table.getTableName()), e);
    }
  }
View Full Code Here

    try {
      Put put = new Put(row(key));
      put.add(FAMILY, QUALIFIER, bytes(value));
      return table.checkAndPut(put.getRow(), FAMILY, QUALIFIER, null /*absent*/, put);
    } catch (IOException e) {
      throw new DrillRuntimeException("Caught error while putting row '" + key + "' from for table:" + Bytes.toString(table.getTableName()), 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.