hudi-agent commented on code in PR #20282:
URL: https://github.com/apache/hudi/pull/20282#discussion_r4238961257
##########
hudi-common/src/main/java/org/apache/hudi/common/model/MetaFieldsMode.java:
##########
@@ -184,9 +184,12 @@ private static MetaFieldsMode parse(String rawMode) {
/**
* @return the equivalent value of the deprecated {@code
hoodie.populate.meta.fields} boolean, so
* that call sites not yet migrated to this enum keep observing consistent
behavior.
+ *
+ * <p>Only {@link #NONE} maps to {@code false}: the boolean says whether any
meta column is
+ * populated, not which. Use {@link #isRecordKeyPopulated()} for
key-dependent checks.
*/
public boolean toLegacyPopulateMetaFields() {
- return this == ALL;
+ return this != NONE;
Review Comment:
🤖 It looks like
`HoodieSparkFileWriterFactory.newLanceFileWriter`/`newVortexFileWriter` pass
`toLegacyPopulateMetaFields()` straight into the writer, so with this change a
`COMMIT_TIME_ONLY`/`FILE_NAME_ONLY` CoW table on Lance or Vortex would write
all five meta columns (including `_hoodie_record_key`, partition path and
seqno), which contradicts the persisted mode; could those two sites gate on
`metaFieldsMode == ALL`, or pass the mode down?
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]