Jackie-Jiang commented on code in PR #8960: URL: https://github.com/apache/pinot/pull/8960#discussion_r910960563
########## pinot-spi/src/main/java/org/apache/pinot/spi/data/DateTimeFieldSpec.java: ########## @@ -70,17 +72,8 @@ public DateTimeFieldSpec() { */ public DateTimeFieldSpec(String name, DataType dataType, String format, String granularity) { super(name, dataType, true); - Preconditions.checkNotNull(name); - Preconditions.checkNotNull(dataType); - if (Character.isDigit(format.charAt(0))) { - DateTimeFormatSpec.validateFormat(format); - } else { - DateTimeFormatSpec.validatePipeFormat(format); - } - DateTimeGranularitySpec.validateGranularity(granularity); - - _format = format; - _granularity = granularity; + setFormat(format); Review Comment: It is covered in `SchemaUtilsTest`. After a second thought, decided to not directly parse the `format` and `granularity` in the setter to prevent the extra overhead of reading schema. The parsing is performed lazily in the getter. -- 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