danny0405 commented on code in PR #19205:
URL: https://github.com/apache/hudi/pull/19205#discussion_r3774039835
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/NineToTenUpgradeHandler.java:
##########
@@ -34,6 +46,12 @@ public UpgradeDowngrade.TableConfigChangeSet upgrade(
HoodieEngineContext context,
String instantTime,
SupportsUpgradeDowngrade upgradeDowngradeHelper) {
- return new UpgradeDowngrade.TableConfigChangeSet();
+ HoodieTableConfig tableConfig =
+ upgradeDowngradeHelper.getTable(config,
context).getMetaClient().getTableConfig();
+ // Resolves from the legacy boolean for a version 9 table, since the mode
property is absent.
+ MetaFieldsMode metaFieldsMode = tableConfig.getMetaFieldsMode();
+ Map<ConfigProperty, String> propertiesToUpdate = Collections.singletonMap(
+ HoodieTableConfig.META_FIELDS_MODE, metaFieldsMode.name());
+ return new UpgradeDowngrade.TableConfigChangeSet(propertiesToUpdate,
Collections.emptySet());
Review Comment:
> so deleting them is unambiguous; POPULATE_META_FIELDS defaults to true, so
deleting it is precisely what creates the silent-widening case above.
I don't think so, at least for the table config, since the mode is inferred
from the `POPULATE_META_FIELDS` and it should be consistent to the boolean
flag, for a table config, always read the mode first then fall back to the
legacy boolean(or we can remove the default value for the legacy flag to reduce
ambiguties).
--
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]