shounakmk219 commented on code in PR #12686:
URL: https://github.com/apache/pinot/pull/12686#discussion_r1551013533
##########
pinot-spi/src/main/java/org/apache/pinot/spi/data/Schema.java:
##########
@@ -785,6 +786,18 @@ public boolean isBackwardCompatibleWith(Schema oldSchema) {
return false;
}
}
+
+ List<String> primaryKeyColumns = getPrimaryKeyColumns();
+ List<String> oldPrimaryKeyColumns = oldSchema.getPrimaryKeyColumns();
+
+ if (primaryKeyColumns == null) {
+ return oldPrimaryKeyColumns == null;
+ }
+
+ if (!Arrays.equals(primaryKeyColumns.toArray(),
oldPrimaryKeyColumns.toArray())) {
+ return false;
+ }
+
return true;
Review Comment:
Got it. We can atleast avoid the null check block above as `Arrays.equals`
will handle that check internally.
--
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]