danny0405 commented on code in PR #11642:
URL: https://github.com/apache/hudi/pull/11642#discussion_r1681936134
##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/util/HiveSchemaUtil.java:
##########
@@ -429,12 +429,12 @@ public static boolean isSchemaTypeUpdateAllowed(String
prevType, String newType)
newType = newType.toLowerCase();
if (prevType.equals(newType)) {
return true;
- } else if (prevType.equalsIgnoreCase(INT_TYPE_NAME) &&
newType.equalsIgnoreCase(BIGINT_TYPE_NAME)) {
- return true;
- } else if (prevType.equalsIgnoreCase(FLOAT_TYPE_NAME) &&
newType.equalsIgnoreCase(DOUBLE_TYPE_NAME)) {
- return true;
+ } else if (prevType.equalsIgnoreCase(STRING_TYPE_NAME) &&
newType.equalsIgnoreCase(BINARY_TYPE_NAME)) {
+ return false;
+ } else if (prevType.equalsIgnoreCase(BINARY_TYPE_NAME) &&
newType.equalsIgnoreCase(STRING_TYPE_NAME)) {
+ return false;
} else {
- return prevType.contains("struct") &&
newType.toLowerCase().contains("struct");
+ return true;
}
Review Comment:
So a bigint can promote to int?
--
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]