You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2019/03/05 15:16:29 UTC

[GitHub] [drill] vdiravka commented on a change in pull request #1672: DRILL-7049 return VARBINARY as a string with escaped non printable bytes

vdiravka commented on a change in pull request #1672: DRILL-7049 return VARBINARY as a string with escaped non printable bytes
URL: https://github.com/apache/drill/pull/1672#discussion_r262529553
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/exec/util/ValueVectorElementFormatter.java
 ##########
 @@ -52,28 +52,51 @@ public ValueVectorElementFormatter(OptionManager options) {
    * @return the formatted value, null if failed
    */
   public String format(Object value, TypeProtos.MinorType minorType) {
+    String str = null;
     switch (minorType) {
       case TIMESTAMP:
         if (value instanceof LocalDateTime) {
-          return format((LocalDateTime) value,
+          str = format((LocalDateTime) value,
                         options.getString(ExecConstants.WEB_DISPLAY_FORMAT_TIMESTAMP),
                         (v, p) -> v.format(getTimestampFormatter(p)));
         }
+        else {
+          str = value.toString();
+        }
+        break;
       case DATE:
         if (value instanceof LocalDate) {
-          return format((LocalDate) value,
+          str = format((LocalDate) value,
                         options.getString(ExecConstants.WEB_DISPLAY_FORMAT_DATE),
                         (v, p) -> v.format(getDateFormatter(p)));
         }
+        else {
+          str = value.toString();
+        }
+        break;
       case TIME:
         if (value instanceof LocalTime) {
-          return format((LocalTime) value,
+          str = format((LocalTime) value,
                         options.getString(ExecConstants.WEB_DISPLAY_FORMAT_TIME),
                         (v, p) -> v.format(getTimeFormatter(p)));
         }
+        else {
+          str = value.toString();
+        }
+        break;
+      case VARBINARY:
+        if(value instanceof byte[]) {
 
 Review comment:
   ```suggestion
           if (value instanceof byte[]) {
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services