}
public static List<UnbackedRecord> getResultAsUnbackedRecords(String resourcePath) throws Exception{
DrillConfig config = getConfigWithQueue(0);
Collection<RunOutcome> outcomes = getOutcome(config, resourcePath);
if(outcomes.size() != 1) throw new Exception("Only supports logical plans that provide a single outcome.");
RunOutcome out = outcomes.iterator().next();
switch(out.outcome){
case CANCELED:
case FAILED:
if(out.exception != null) throw (Exception) out.exception;
throw new Exception("Failure while running query.");
}
Object o;
Queue<Object> q = config.getQueue(0);
List<UnbackedRecord> records = Lists.newArrayList();
while( (o = q.poll()) != null){
if(o instanceof OutcomeType) continue;
if( !(o instanceof UnbackedRecord) ) throw new Exception(String.format("This method only works when the QueueRSE is configured to use RECORD encoding. One of the queue objects was of type %s", o.getClass().getCanonicalName()));
records.add( (UnbackedRecord) o);