[ 
https://issues.apache.org/jira/browse/DRILL-6544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16605713#comment-16605713
 ] 

ASF GitHub Bot commented on DRILL-6544:
---------------------------------------

agozhiy commented on a change in pull request #1449: DRILL-6544: Timestamp 
value in Drill UI showed inconsistently with th…
URL: https://github.com/apache/drill/pull/1449#discussion_r215606136
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/util/VectorUtil.java
 ##########
 @@ -227,4 +233,69 @@ private static int getColumnWidth(int[] columnWidths, int 
columnIndex) {
     return (columnWidths == null) ? DEFAULT_COLUMN_WIDTH
         : (columnWidths.length > columnIndex) ? columnWidths[columnIndex] : 
columnWidths[0];
   }
+
+  /**
+   * Formats ValueVector elements in accordance with the corresponding 
system/session options.
+   *
+   * @param value ValueVector element to format, not null
+   * @param minorType the minor type of the element, not null
+   * @param options the OptionManager instance, not null
+   * @return the formatted value, null if failed
+   */
+  public static String formatValueVectorElement(Object value, 
TypeProtos.MinorType minorType, OptionManager options) {
+    String formattedValue = null;
+    switch (minorType) {
+      case TIMESTAMP:
+        if (value instanceof LocalDateTime) {
+          String formatPattern = 
options.getString(ExecConstants.WEB_TIMESTAMP_DISPLAY_FORMAT);
+          if (!formatPattern.isEmpty()) {
 
 Review comment:
   Moved this check to a separate method.

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


> Timestamp value in Drill UI showed inconsistently with the same value 
> retrieved from sqline
> -------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6544
>                 URL: https://issues.apache.org/jira/browse/DRILL-6544
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.14.0
>            Reporter: Anton Gozhiy
>            Assignee: Anton Gozhiy
>            Priority: Minor
>
> *Query:*
> {code:sql}
> select timestamp '2008-2-23 12:23:34' from (values(1));
> {code}
> *Expected result (from sqline):*
> 2008-02-23 12:23:34.0
> *Actual result (from Drill UI):*
> 2008-02-23T12:23:34



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to