You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/05/02 21:00:48 UTC

[GitHub] [pinot] ddcprg commented on a diff in pull request #8625: Add support to select timestamp arrays

ddcprg commented on code in PR #8625:
URL: https://github.com/apache/pinot/pull/8625#discussion_r863186080


##########
pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java:
##########
@@ -597,6 +599,14 @@ public static Serializable getFormattedValue(Object value, ColumnDataType dataTy
           }
         }
         return formattedValue;
+      case TIMESTAMP_ARRAY:
+        long[] timestamps = (long[]) value;
+        length = timestamps.length;
+        formattedValue = new String[length];
+        for (int i = 0; i < length; i++) {
+          formattedValue[i] = new Timestamp(timestamps[i]).toString();

Review Comment:
   there are time-zone-related issues because of using `java.sql.Timestamp` to format timestamps



##########
pinot-core/src/test/java/org/apache/pinot/core/query/selection/SelectionOperatorServiceTest.java:
##########
@@ -235,11 +238,11 @@ public void testCompatibleRowsRenderSelectionResultsWithoutOrdering() {
     List<Serializable[]> resultRows = selectionResults.getRows();
     Serializable[] expectedRow1 = {
         0L, 1.0, 2.0, 3.0, "4", new long[]{5L}, new double[]{6.0}, new double[]{7.0}, new double[]{8.0},
-        new String[]{"9"}, "1020"
+        new String[]{"9"}, "1020", "2022-05-02 14:47:35.0", new String[]{"2022-05-02 14:47:35.0"}

Review Comment:
   new tests asserting timestamp and timestamp array formatting will only run on machines with date/time set to UTC 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org