drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #851: DRILL-5518: Test framework enhancements
Date Thu, 22 Jun 2017 17:14:10 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/851#discussion_r123567643
  
    --- 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 --
    
    Fixed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message