MeihanLi commented on code in PR #9382: URL: https://github.com/apache/pinot/pull/9382#discussion_r969992785
########## pinot-spi/src/main/java/org/apache/pinot/spi/data/FieldSpec.java: ########## @@ -536,4 +536,22 @@ public int compareTo(FieldSpec otherSpec) { // Sort fieldspecs based on their name return _name.compareTo(otherSpec._name); } + + /*** + * Return true if it is backward compatible with the old FieldSpec. + * Backward compatibility requires + * all other fields except DefaultNullValue and Max Length should be retained. + * + * @param oldFieldSpec + * @return + */ + public boolean isBackwardCompatibleWith(FieldSpec oldFieldSpec) { + + return EqualityUtils.isEqual(_name, oldFieldSpec._name) + && EqualityUtils.isEqual(_dataType, oldFieldSpec._dataType) + && EqualityUtils.isEqual(_isSingleValueField, oldFieldSpec._isSingleValueField) + && EqualityUtils.isEqual(_transformFunction, oldFieldSpec._transformFunction) + && EqualityUtils. + isEqual(_virtualColumnProvider, oldFieldSpec._virtualColumnProvider); Review Comment: done, please check the third commit -- 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