Example #1
0
 private void checkAllowedOlderTypes(
     DataSchema.Type olderType, DataSchema.Type newerType, DataSchema.Type... allowedOlderTypes) {
   if (_options.isAllowPromotions()) {
     if (olderType != newerType) {
       boolean allowed = false;
       for (DataSchema.Type type : allowedOlderTypes) {
         if (type == olderType) {
           allowed = true;
           break;
         }
       }
       if (allowed) {
         appendMessage(
             CompatibilityMessage.Impact.VALUES_MAY_BE_TRUNCATED_OR_OVERFLOW,
             "numeric type promoted from %s to %s",
             olderType.toString().toLowerCase(),
             newerType.toString().toLowerCase());
       } else {
         appendTypeChangedMessage(olderType, newerType);
       }
     }
   } else {
     isSameType(olderType, newerType);
   }
 }
Example #2
0
 private void appendTypeChangedMessage(DataSchema.Type olderType, DataSchema.Type newerType) {
   appendMessage(
       CompatibilityMessage.Impact.BREAKS_NEW_AND_OLD_READERS,
       "schema type changed from %s to %s",
       olderType.toString().toLowerCase(),
       newerType.toString().toLowerCase());
 }