Jackie-Jiang commented on code in PR #8960:
URL: https://github.com/apache/pinot/pull/8960#discussion_r905611444
##########
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:
Good catch!
--
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]