Jackie-Jiang commented on code in PR #9505:
URL: https://github.com/apache/pinot/pull/9505#discussion_r995155971


##########
pinot-controller/src/test/java/org/apache/pinot/controller/utils/SegmentMetadataMockUtils.java:
##########
@@ -46,12 +46,13 @@ public static SegmentMetadata mockSegmentMetadata(String 
tableName, String segme
     Mockito.when(segmentMetadata.getName()).thenReturn(segmentName);
     Mockito.when(segmentMetadata.getTotalDocs()).thenReturn(numTotalDocs);
     Mockito.when(segmentMetadata.getCrc()).thenReturn(crc);
-    Mockito.when(segmentMetadata.getStartTime()).thenReturn(1L);
-    Mockito.when(segmentMetadata.getEndTime()).thenReturn(10L);
+    Mockito.when(segmentMetadata.getTimeColumn()).thenReturn(tableName);

Review Comment:
   (minor) Put a dummy time column name such as `"timeCol"`, same for line 105



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentColumnarIndexCreator.java:
##########
@@ -758,18 +768,20 @@ private void writeMetadata()
           }
         }
 
+        Interval timeInterval =
+            new Interval(timeUnit.toMillis(startTime), 
timeUnit.toMillis(endTime), DateTimeZone.UTC);
+        boolean isValidTimeInterval = 
TimeUtils.isValidTimeInterval(timeInterval);
         if (!_config.isSkipTimeValueCheck()) {

Review Comment:
   (minor) Suggest changing the check order a little bit and log a warning when 
time interval is not valid, but time value check is skipped
   ```suggestion
           if (isValidTimeInterval) {
             setSegmentTimeInterval(properties, startTime, endTime, timeUnit);
           } else {
             if (_config.isSkipTimeValueCheck()) {
               LOGGER.warn(...);
             } else {
               throw new IllegalStateException(...);
             }
           }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to