deepthi912 commented on code in PR #17645:
URL: https://github.com/apache/pinot/pull/17645#discussion_r2876015547


##########
pinot-spi/src/main/java/org/apache/pinot/spi/data/Schema.java:
##########
@@ -840,10 +840,20 @@ public void updateBooleanFieldsIfNeeded(Schema oldSchema) 
{
    * Backward compatibility requires
    * (1) all columns in oldSchema should be retained.
    * (2) all column fieldSpecs should be backward compatible with the old ones.
+   * (3) primary key columns should not be changed (used in dimension tables, 
upsert, and dedup).
    *
    * @param oldSchema old schema
    */
   public boolean isBackwardCompatibleWith(Schema oldSchema) {
+    // Check primary key columns are not changed
+    List<String> oldPrimaryKeys = oldSchema.getPrimaryKeyColumns();
+    List<String> newPrimaryKeys = getPrimaryKeyColumns();
+    if (oldPrimaryKeys != null && !oldPrimaryKeys.isEmpty()) {

Review Comment:
   Actually, comparing it with list makes more sense as order matters, so 
changed it back to comparing it as a list



-- 
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]

Reply via email to