hudi-agent commented on code in PR #18721:
URL: https://github.com/apache/hudi/pull/18721#discussion_r3654055048
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java:
##########
@@ -3883,6 +3884,23 @@ private void validate() {
checkArgument(ttlStatsMaxParallelism > 0,
String.format("%s must be positive, but was %d",
HoodieTTLConfig.STATS_MAX_PARALLELISM.key(),
ttlStatsMaxParallelism));
+
+ validateEventTimeConfigs();
+ }
+
+ private void validateEventTimeConfigs() {
+ // Event-time field is configured but watermark tracking is off — the
field
+ // will be ignored at commit time. Surface a hint so the user can opt in
via
+ // TRACK_EVENT_TIME_WATERMARK.
+ String eventTimeFieldName =
writeConfig.getString(HoodiePayloadProps.PAYLOAD_EVENT_TIME_FIELD_PROP_KEY);
+ if (!StringUtils.isNullOrEmpty(eventTimeFieldName)
+ && !writeConfig.getBooleanOrDefault(TRACK_EVENT_TIME_WATERMARK)) {
+ log.warn("{}={} is configured but {}={}; event-time watermark metadata
will not be tracked. "
+ + "Set {}=true to record event-time watermark in commit
metadata.",
+ HoodiePayloadProps.PAYLOAD_EVENT_TIME_FIELD_PROP_KEY,
eventTimeFieldName,
+ TRACK_EVENT_TIME_WATERMARK.key(),
writeConfig.getBooleanOrDefault(TRACK_EVENT_TIME_WATERMARK),
Review Comment:
🤖 nit: `writeConfig.getBooleanOrDefault(TRACK_EVENT_TIME_WATERMARK)` here is
always `false` since we're already inside the `!getBooleanOrDefault(...)`
branch — could you just inline `false` (or extract the boolean to a local
variable before the `if`) so a future reader doesn't have to reason about
whether this could ever be `true`?
<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]