Davis-Zhang-Onehouse commented on code in PR #13520:
URL: https://github.com/apache/hudi/pull/13520#discussion_r2191242493
##########
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 prefer to keep this as tight as possible since:
- This caller of the function is consumed in multiple places which I don't
have the full context, not sure if they always leads to upgrade/downgrade
- if they don't, then we have the problem as it is not always backward
compatible to write old table version with new version writer (for example,
hudi 1.x does not support MDT of 0.x)
I would suggest to not expanding the scope but do things we know that are
absolutely safe here. We know if table version is 8 and writer is 9, regardless
of upgrading or not, nothing will break.
--
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]