@Override public Tuple getNext() throws IOException { try { HCatRecord hr = (HCatRecord) (reader.nextKeyValue() ? reader.getCurrentValue() : null); Tuple t = PigHCatUtil.transformToTuple(hr, outputSchema); // TODO : we were discussing an iter interface, and also a LazyTuple // change this when plans for that solidifies. return t; } catch (ExecException e) { int errCode = 6018; String errMsg = "Error while reading input"; throw new ExecException(errMsg, errCode, PigException.REMOTE_ENVIRONMENT, e); } catch (Exception eOther) { int errCode = 6018; String errMsg = "Error converting read value to tuple"; throw new ExecException(errMsg, errCode, PigException.REMOTE_ENVIRONMENT, eOther); } }
/** * Create a new {@link ExecutableManager} depending on the ExecType. * * @return a new {@link ExecutableManager} depending on the ExecType * @throws ExecException */ public ExecutableManager createExecutableManager() throws ExecException { if (executionEngine != null) { return executionEngine.getExecutableManager(); } return null; }
+ zkQuorum + "', '-batchSize 1000');"); if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) { throw new RuntimeException("Job failed", pigServer.executeBatch() .get(0).getException());
@Override public Tuple getNext() throws IOException { try { if(!reader.nextKeyValue()) { return null; } final PhoenixRecordWritable record = reader.getCurrentValue(); if(record == null) { return null; } final Tuple tuple = TypeUtil.transformToTuple(record, schema.getFields()); return tuple; } catch (InterruptedException e) { Thread.currentThread().interrupt(); int errCode = 6018; final String errMsg = "Error while reading input"; throw new ExecException(errMsg, errCode,PigException.REMOTE_ENVIRONMENT, e); } }
if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) { throw new RuntimeException("Job failed", pigServer.executeBatch() .get(0).getException());
/** * TextLoader does not support conversion to Bag * @throws IOException if the value cannot be cast. */ public DataBag bytesToBag(byte[] b, ResourceFieldSchema schema) throws IOException { int errCode = 2109; String msg = "TextLoader does not support conversion to Bag."; throw new ExecException(msg, errCode, PigException.BUG); }
+ zkQuorum + "', '-batchSize 1000');"); if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) { throw new RuntimeException("Job failed", pigServer.executeBatch() .get(0).getException());
public byte[] toBytes(Double d) throws IOException { int errCode = 2109; String msg = "TextLoader does not support conversion from Double."; throw new ExecException(msg, errCode, PigException.BUG); }
if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) { throw new RuntimeException("Job failed", pigServer.executeBatch() .get(0).getException());
public byte[] toBytes(Float f) throws IOException { int errCode = 2109; String msg = "TextLoader does not support conversion from Float."; throw new ExecException(msg, errCode, PigException.BUG); }
+ zkQuorum + "', '-batchSize 1000');"); if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) { throw new RuntimeException("Job failed", pigServer.executeBatch() .get(0).getException());
public byte[] toBytes(Long l) throws IOException { int errCode = 2109; String msg = "TextLoader does not support conversion from Long."; throw new ExecException(msg, errCode, PigException.BUG); }
/** * NOT IMPLEMENTED */ @Override public Tuple bytesToTuple(byte[] b, ResourceFieldSchema fieldSchema) throws IOException { throw new ExecException("Can't generate a Tuple from byte[]"); }
/** * TextLoader does not support conversion to DateTime * @throws IOException if the value cannot be cast. */ @Override public DateTime bytesToDateTime(byte[] b) throws IOException { int errCode = 2109; String msg = "TextLoader does not support conversion to DateTime."; throw new ExecException(msg, errCode, PigException.BUG); }
public byte[] toBytes(Boolean b) throws IOException { int errCode = 2109; String msg = "TextLoader does not support conversion from Boolean."; throw new ExecException(msg, errCode, PigException.BUG); }
public byte[] toBytes(Integer i) throws IOException { int errCode = 2109; String msg = "TextLoader does not support conversion from Integer."; throw new ExecException(msg, errCode, PigException.BUG); }
@Override public BigInteger bytesToBigInteger(byte[] b) throws IOException { int errCode = 2109; String msg = "TextLoader does not support conversion to BigInteger."; throw new ExecException(msg, errCode, PigException.BUG); }
private Tuple getAggResultTuple(Object result) throws ExecException { try { return (Tuple) result; } catch (ClassCastException ex) { throw new ExecException("Intermediate Algebraic " + "functions must implement EvalFunc<Tuple>"); } }
/** * Not implemented! */ @Override public BigDecimal bytesToBigDecimal(byte[] b) throws IOException { throw new ExecException("Can't generate a BigInteger from byte[]"); }
@Override public void write(DataOutput out) throws IOException { int errCode = 2142; String msg = "ReadOnceBag should never be serialized."; throw new ExecException(msg, errCode, PigException.BUG); }