@Override public Object readObject() { return vector.getObject(idx()); }
/** * This method is a helper method added for DRILL-951 * TextRecordReader to call this method to get field names out * @return array of field data strings */ public String [] getTextOutput () throws ExecutionSetupException { if (recordCount == 0 || fieldIndex == -1) { return null; } //Currently only first line header is supported. Return only first record. int retSize = fieldIndex+1; String [] out = new String [retSize]; try { ListVector listVector = output.addField(new Field(COL_NAME, true, MinorType.LIST.getType(), null), ListVector.class); List outputlist = (List) listVector.getObject((int)(recordCount-1)); for (int i=0; i<retSize; i++){ out[i] = ((Text) outputlist.get(i)).toString(); } return out; } catch (SchemaChangeException e) { throw new ExecutionSetupException(e); } }