Github user sohami commented on a diff in the pull request: https://github.com/apache/drill/pull/851#discussion_r122857402 --- Diff: exec/vector/src/main/java/org/apache/drill/exec/vector/accessor/impl/TupleReaderImpl.java --- @@ -101,8 +88,61 @@ public String getAsString(int colIndex) { return "\"" + colReader.getString() + "\""; case DECIMAL: return colReader.getDecimal().toPlainString(); + case ARRAY: + return getArrayAsString(colReader.array()); default: throw new IllegalArgumentException("Unsupported type " + colReader.valueType()); } } + + private String bytesToString(byte[] value) { + StringBuilder buf = new StringBuilder() + .append("["); + int len = Math.min(value.length, 20); + for (int i = 0; i < len; i++) { + if (i > 0) { + buf.append(", "); + } + buf.append((int) value[i]); + } + if (value.length > len) { + buf.append("..."); + } + buf.append("]"); + return buf.toString(); + } + + private String getArrayAsString(ArrayReader array) { + StringBuilder buf = new StringBuilder(); + buf.append("["); + for (int i = 0; i < array.size(); i++) { + if (i > 0) { + buf.append( ", " ); + } + switch (array.valueType()) { --- End diff -- for valueType `MAP` and `ARRAY` we should `throw UnsupportedOperationException()`
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---