Skip to content

[GOBBLIN-ICEBERG] Restore backward compat: CURRENT_DATE produces -00 …#4185

Merged
Blazer-007 merged 3 commits intoapache:masterfrom
debabhishek53:master
Apr 9, 2026
Merged

[GOBBLIN-ICEBERG] Restore backward compat: CURRENT_DATE produces -00 …#4185
Blazer-007 merged 3 commits intoapache:masterfrom
debabhishek53:master

Conversation

@debabhishek53
Copy link
Copy Markdown
Contributor

Summary

Before this fix, CURRENT_DATE in the legacy path (no iceberg.partition.value.datetime.format set)
resolved to LocalDateTime.now(), causing the default yyyy-MM-dd-HH formatter to embed the live
clock-hour (e.g. 2026-04-06-20) instead of the expected -00 suffix. This silently broke scheduled
flows whose tables store daily data in yyyy-MM-dd-00 partitions — resulting in 0 files discovered
at any hour other than midnight.

Fix: split CURRENT_DATE resolution by path:

  • Legacy path (iceberg.partition.value.datetime.format absent) → LocalDate.now().atStartOfDay() — hour is always 00, preserving pre-PR behavior
  • Custom format path (iceberg.partition.value.datetime.format set) → LocalDateTime.now() — live clock-hour is embedded for truly hourly-partitioned tables

Testing

  • Updated testCurrentDatePlaceholder to assert today + "-00" (strict backward compat, deterministic)
  • Added testCurrentDatePlaceholderWithCustomFormat for the live-hour path (regex-based to avoid clock flakiness)

Migration Guide

  • Daily-at-midnight partitions (yyyy-MM-dd-00): no change needed — legacy default is preserved
  • Truly hourly tables needing live hour: set iceberg.partition.value.datetime.format=yyyy-MM-dd-HH

@debabhishek53 debabhishek53 requested a review from Blazer-007 April 9, 2026 05:43
@debabhishek53 debabhishek53 requested a review from Blazer-007 April 9, 2026 07:30
@Blazer-007 Blazer-007 merged commit 5af94dc into apache:master Apr 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants