danny0405 commented on code in PR #13520:
URL: https://github.com/apache/hudi/pull/13520#discussion_r2191289071
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/util/CommonClientUtils.java:
##########
@@ -72,6 +68,21 @@ public static void validateTableVersion(HoodieTableConfig
tableConfig, HoodieWri
}
}
+ public static boolean isValidTableVersionWriteVersionPair(HoodieTableVersion
tableVersion, HoodieTableVersion writeVersion) {
+ if (tableVersion.equals(writeVersion)) {
+ return true;
+ }
+ if (tableVersion.greaterThan(HoodieTableVersion.SIX) &&
tableVersion.lesserThan(HoodieTableVersion.NINE) &&
writeVersion.equals(HoodieTableVersion.SIX)) {
+ LOG.warn("Table version is greater than 6 and lower than 9, while writer
version is 6. Allowing it for upgrade.");
+ return true;
+ }
+ if (tableVersion.equals(HoodieTableVersion.EIGHT) &&
writeVersion.equals(HoodieTableVersion.NINE)) {
Review Comment:
I don't think we need to twich this logic everytime we add a new table
version, please loosen the restriction or make the logic more generalized.
Did you noticed that we already have forced automatic table version upgrade
for every commit:
https://github.com/apache/hudi/blob/f80fc25fe906686694557b5d8d2f68f9b5c9215e/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java#L1017
--
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]