xiangfu0 commented on code in PR #8960:
URL: https://github.com/apache/pinot/pull/8960#discussion_r905583504


##########
pinot-plugins/pinot-batch-ingestion/v0_deprecated/pinot-hadoop/src/main/java/org/apache/pinot/hadoop/job/mappers/SegmentPreprocessingMapper.java:
##########
@@ -68,15 +68,36 @@ public void setup(final Context context) {
       String timeColumnValue = 
_jobConf.get(InternalConfigConstants.TIME_COLUMN_VALUE);
       String pushFrequency = 
_jobConf.get(InternalConfigConstants.SEGMENT_PUSH_FREQUENCY);
 
-      String timeType = 
_jobConf.get(InternalConfigConstants.SEGMENT_TIME_TYPE);
-      String timeFormat = 
_jobConf.get(InternalConfigConstants.SEGMENT_TIME_FORMAT);
+      String timeFormatStr = 
_jobConf.get(InternalConfigConstants.SEGMENT_TIME_FORMAT);
+      DateTimeFieldSpec.TimeFormat timeFormat;
+      try {
+        timeFormat = DateTimeFieldSpec.TimeFormat.valueOf(timeFormatStr);
+      } catch (Exception e) {
+        throw new IllegalArgumentException("Invalid time format: " + 
timeFormatStr);
+      }
       DateTimeFormatSpec dateTimeFormatSpec;
-      if (timeFormat.equals(DateTimeFieldSpec.TimeFormat.EPOCH.toString()) || 
timeFormat.equals(
-          DateTimeFieldSpec.TimeFormat.TIMESTAMP.toString())) {
-        dateTimeFormatSpec = new DateTimeFormatSpec(1, timeType, timeFormat);
-      } else {
-        dateTimeFormatSpec = new DateTimeFormatSpec(1, timeType, timeFormat,
-            _jobConf.get(InternalConfigConstants.SEGMENT_TIME_SDF_PATTERN));
+      switch (timeFormat) {
+        case EPOCH:

Review Comment:
   This should be case SIMPLE_DATE_FORMAT ?



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to