KKcorps commented on code in PR #8779: URL: https://github.com/apache/pinot/pull/8779#discussion_r884059047
########## pinot-spi/src/main/java/org/apache/pinot/spi/data/DateTimeFormatSpec.java: ########## @@ -199,6 +270,26 @@ public static void validateFormat(String format) { "Incorrect format type: %s in format: %s. Must be of '[0-9]+:<TimeUnit>:SIMPLE_DATE_FORMAT:pattern'", formatTokens[FORMAT_TIMEFORMAT_POSITION], format); } + return formatTokens; + } + + /** + * Validates the pipe format string in the dateTimeFieldSpec + */ + public static String[] validatePipeFormat(String format) { + Preconditions.checkNotNull(format, "Format string in dateTimeFieldSpec must not be null"); + String[] formatTokens = StringUtils.split(format, PIPE_SEPARATOR, MAX_FORMAT_TOKENS_PIPE); + Preconditions.checkState(formatTokens.length >= MIN_FORMAT_TOKENS_PIPE + && formatTokens.length <= MAX_FORMAT_TOKENS_PIPE, + "Incorrect format: %s. Must be of the format 'EPOCH|<timeUnit>(|<size>)'" + + " or 'SDF|<timeFormat>(|<timezone>)' or 'TIMESTAMP'"); + if (formatTokens.length == MAX_FORMAT_TOKENS_PIPE + && formatTokens[FORMAT_SIZE_POSITION].equals(TimeFormat.EPOCH.toString())) { Review Comment: Any reason why we are not validating the `SDF` format here? -- 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