schemaChanged = currentBatchHolder.load(qrb.getHeader().getDef(), qrb.getData());
protected Object[] getRunResult(QueryType queryType, String planString) throws Exception { List<QueryDataBatch> resultList = testRunAndReturn(queryType, planString); List<Object> res = new ArrayList<Object>(); RecordBatchLoader loader = new RecordBatchLoader(getAllocator()); for(QueryDataBatch result : resultList) { if (result.getData() != null) { loader.load(result.getHeader().getDef(), result.getData()); ValueVector v = loader.iterator().next().getValueVector(); for (int j = 0; j < v.getAccessor().getValueCount(); j++) { if (v instanceof VarCharVector) { res.add(new String(((VarCharVector) v).getAccessor().get(j))); } else { res.add(v.getAccessor().getObject(j)); } } loader.clear(); result.release(); } } return res.toArray(); }
@Override protected void rowArrived(QueryDataBatch result) { try { final RecordBatchLoader loader = new RecordBatchLoader(getAllocator()); loader.load(result.getHeader().getDef(), result.getData()); StringBuilder sb = new StringBuilder(); VectorUtil.appendVectorAccessibleContent(loader, sb, "|", false); loader.clear(); queryResult.set("result", sb.toString()); } catch (SchemaChangeException e) { queryResult.set("error", "true"); } } };
schemaChanged = currentBatchHolder.load(qrb.getHeader().getDef(), qrb.getData());
loader.load(result.getHeader().getDef(), bufferWithData);
count.addAndGet(header.getRowCount()); try { loader.load(header.getDef(), data);
public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.QueryData other) { if (other == org.apache.drill.exec.proto.UserBitShared.QueryData.getDefaultInstance()) return this; if (other.hasQueryId()) { mergeQueryId(other.getQueryId()); } if (other.hasRowCount()) { setRowCount(other.getRowCount()); } if (other.hasDef()) { mergeDef(other.getDef()); } if (other.hasAffectedRowsCount()) { setAffectedRowsCount(other.getAffectedRowsCount()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserBitShared.QueryData message) throws java.io.IOException { if(message.hasQueryId()) output.writeObject(1, message.getQueryId(), org.apache.drill.exec.proto.SchemaUserBitShared.QueryId.WRITE, false); if(message.hasRowCount()) output.writeInt32(2, message.getRowCount(), false); if(message.hasDef()) output.writeObject(3, message.getDef(), org.apache.drill.exec.proto.SchemaUserBitShared.RecordBatchDef.WRITE, false); if(message.hasAffectedRowsCount()) output.writeInt32(4, message.getAffectedRowsCount(), false); } public boolean isInitialized(org.apache.drill.exec.proto.UserBitShared.QueryData message)
@Override public void sendData(RpcOutcomeListener<Ack> listener, QueryWritableBatch result) { // Save the query results schema and release the buffers. if (fields == null) { fields = result.getHeader().getDef().getFieldList(); } for (ByteBuf buf : result.getBuffers()) { buf.release(); } listener.success(Acks.OK, null); }
batchLoader.load(result.getHeader().getDef(), result.getData()); if (batchLoader.getRecordCount() <= 0) { result.release();
batchLoader.load(result.getHeader().getDef(), result.getData()); if (batchLoader.getRecordCount() <= 0) { result.release();
public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.QueryData other) { if (other == org.apache.drill.exec.proto.UserBitShared.QueryData.getDefaultInstance()) return this; if (other.hasQueryId()) { mergeQueryId(other.getQueryId()); } if (other.hasRowCount()) { setRowCount(other.getRowCount()); } if (other.hasDef()) { mergeDef(other.getDef()); } if (other.hasAffectedRowsCount()) { setAffectedRowsCount(other.getAffectedRowsCount()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserBitShared.QueryData message) throws java.io.IOException { if(message.hasQueryId()) output.writeObject(1, message.getQueryId(), org.apache.drill.exec.proto.SchemaUserBitShared.QueryId.WRITE, false); if(message.hasRowCount()) output.writeInt32(2, message.getRowCount(), false); if(message.hasDef()) output.writeObject(3, message.getDef(), org.apache.drill.exec.proto.SchemaUserBitShared.RecordBatchDef.WRITE, false); if(message.hasAffectedRowsCount()) output.writeInt32(4, message.getAffectedRowsCount(), false); } public boolean isInitialized(org.apache.drill.exec.proto.UserBitShared.QueryData message)