You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/08/05 23:41:09 UTC

[GitHub] [pinot] klsince commented on a change in pull request #7259: Treat STRING to BOOLEAN data type change as backward compatible schema change

klsince commented on a change in pull request #7259:
URL: https://github.com/apache/pinot/pull/7259#discussion_r683852369



##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/data/Schema.java
##########
@@ -673,7 +679,15 @@ public boolean isBackwardCompatibleWith(Schema oldSchema) {
       FieldSpec oldSchemaFieldSpec = entry.getValue();
       FieldSpec fieldSpec = getFieldSpecFor(oldSchemaColumnName);
       if (!fieldSpec.equals(oldSchemaFieldSpec)) {
-        return false;
+        if (fieldSpec.getDataType() == DataType.BOOLEAN) {
+          // For BOOLEAN data type, replace with STRING and compare again to keep backward-compatibility
+          fieldSpec.setDataType(DataType.STRING);

Review comment:
       It looks like if the schema is mutated here, we'll persist this updated schema to ZK. Would this schema work with data of new Boolean type? e.g. an ingestion job may be about to output some Boolean values to the table (not sure if this is a valid scenario).




-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org