arina-ielchiieva 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_r214915641
##########
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) {
Review comment:
Creating format instance for each record is rather expensive, plus you'll be
writing errors on each incorrect record call which will pollute the log. I was
thinking that you can consider having some format class instance which will be
created before you start iterating over vectors (`for (VectorWrapper<?> vw :
loader) {`). This format class will accept options in constructor and have
format method where you would pass value and minor type. Formatters for
timestamp / date / time will be created upon necessity and stored for further
re-use.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services