danny0405 commented on code in PR #19205:
URL: https://github.com/apache/hudi/pull/19205#discussion_r3651784603
##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java:
##########
@@ -1230,11 +1250,58 @@ public String getTimelinePath() {
/**
* @returns true is meta fields need to be populated. else returns false.
+ *
+ * <p>Derived from {@link #getMetaFieldsMode()} so that call sites still
written against the
+ * deprecated boolean observe the same answer as the enum: only {@link
MetaFieldsMode#ALL}
+ * populates every meta column. Selective modes report {@code false} here,
which keeps
+ * key-dependent machinery (bloom filters, record-level index) correctly
disabled.
*/
public boolean populateMetaFields() {
+ return getMetaFieldsMode().toLegacyPopulateMetaFields();
+ }
+
+ /**
+ * @return the raw, deprecated {@code hoodie.populate.meta.fields} value,
used only as the
+ * fallback when {@link #META_FIELDS_MODE} is absent. Callers should use
+ * {@link #getMetaFieldsMode()} instead.
+ */
+ private boolean legacyPopulateMetaFields() {
return Boolean.parseBoolean(getStringOrDefault(POPULATE_META_FIELDS));
}
+ /**
+ * @return the {@link MetaFieldsMode} resolved from the on-disk properties.
{@link #META_FIELDS_MODE}
+ * is the source of truth; tables written before that property existed fall
back to
+ * {@link MetaFieldsMode#ALL} or {@link MetaFieldsMode#NONE} based on the
deprecated
+ * {@link #POPULATE_META_FIELDS} boolean.
+ */
+ public MetaFieldsMode getMetaFieldsMode() {
+ return MetaFieldsMode.resolve(getStringOrDefault(META_FIELDS_MODE),
legacyPopulateMetaFields());
Review Comment:
can we do the inference/transformation(from legacy option to new) in one
shot on table creation instead of reading the lecagy option each time?
--
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]