klsince commented on code in PR #12686:
URL: https://github.com/apache/pinot/pull/12686#discussion_r1552156660
##########
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:
actually, there was this `// TODO: Add the reason of the incompatibility`
```
boolean isBackwardCompatible =
schema.isBackwardCompatibleWith(oldSchema);
if (!isBackwardCompatible) {
if (forceTableSchemaUpdate) {
LOGGER.warn("Force updated schema: {} which is backward incompatible
with the existing schema", oldSchema);
} else {
// TODO: Add the reason of the incompatibility
throw new SchemaBackwardIncompatibleException(
String.format("New schema: %s is not backward-compatible with
the existing schema", schemaName));
}
}
```
would it be ok to fix this TODO in this PR as well, since we're adding more
checks for incompatibility.
--
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]