From fb9e12f77eb46bd2fecedc6b7b063083b1003df7 Mon Sep 17 00:00:00 2001 From: Abhishek Deb Date: Thu, 9 Apr 2026 00:30:25 +0530 Subject: [PATCH 1/3] [GOBBLIN-ICEBERG] Restore backward compat: CURRENT_DATE produces -00 in legacy hourly mode --- .../copy/iceberg/IcebergSource.java | 76 ++++++++++++------- .../copy/iceberg/IcebergSourceTest.java | 34 ++++++++- 2 files changed, 81 insertions(+), 29 deletions(-) diff --git a/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java b/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java index 50d817e8092..6449c072d17 100644 --- a/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java +++ b/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java @@ -96,9 +96,11 @@ * # --- Recommended: configurable partition value format --- * # iceberg.partition.value.datetime.format is a DateTimeFormatter pattern applied to the output * # partition value used in the filter expression. - * # When CURRENT_DATE is used, the reference datetime is LocalDateTime.now(), so a pattern - * # with HH will embed the current hour automatically — no separate hour config needed. * # When set, it supersedes iceberg.hourly.partition.enabled. + * # + * # CURRENT_DATE behaviour: + * # - With this property set → LocalDateTime.now(), so HH embeds the live clock-hour. + * # - Without this property (legacy) → LocalDate.now() at midnight, HH stays -00 (backward compat). * * # Standard hourly partitions (yyyy-MM-dd-HH) — CURRENT_DATE picks up live hour * iceberg.partition.value.datetime.format=yyyy-MM-dd-HH # → "2025-04-01-14" (current hour) @@ -152,10 +154,18 @@ public class IcebergSource extends FileBasedSource /** * Optional {@link DateTimeFormatter} pattern controlling how the partition value is rendered. * - *

When {@code iceberg.filter.date=CURRENT_DATE} the reference datetime is - * {@link java.time.LocalDateTime#now()}, so a pattern that includes {@code HH} will embed - * the current clock-hour automatically — no separate hour config is needed. - * For a specific date (e.g. {@code 2025-04-03}), the time defaults to midnight (00:00). + *

CURRENT_DATE behaviour differs between the two paths: + *

+ * For a static date value (e.g. {@code 2025-04-03}), the time always defaults to midnight (00:00) + * regardless of which path is used. * *

Examples: *