[GOBBLIN-ICEBERG] Add configurable partition filter with hourly look…#4171
Open
debabhishek53 wants to merge 8 commits intoapache:masterfrom
Open
[GOBBLIN-ICEBERG] Add configurable partition filter with hourly look…#4171debabhishek53 wants to merge 8 commits intoapache:masterfrom
debabhishek53 wants to merge 8 commits intoapache:masterfrom
Conversation
…back support
- Introduce IcebergPartitionFilterGenerator utility for reusable Iceberg OR
expression building (forDays, forHours, buildOrExpression)
- Add iceberg.partition.value.format for arbitrary DateTimeFormatter patterns
- Add iceberg.partition.hour (0-23) for explicit hour control in daily partitions
- Add iceberg.lookback.hours for hour-level granularity, takes precedence over
iceberg.lookback.days when set
There was a problem hiding this comment.
Pull request overview
This PR generalizes Iceberg partition filtering in IcebergSource by introducing configurable partition value formatting, hour control, and hour-granularity lookback, and by extracting reusable partition filter generation logic into a new utility.
Changes:
- Add
iceberg.partition.value.format,iceberg.partition.hour, andiceberg.lookback.hourssupport (withlookback.hourstaking precedence when > 0). - Refactor
IcebergSourcepartition filter generation to use the newIcebergPartitionFilterGeneratorutility. - Add extensive unit test coverage for the new generator utility and the new/legacy config paths in
IcebergSource.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java | Adds new configs and refactors partition filter generation to use a formatter + generator, including hourly lookback precedence. |
| gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergPartitionFilterGenerator.java | Introduces a config-agnostic utility to generate partition value lists and OR filter expressions for day/hour lookbacks. |
| gobblin-data-management/src/test/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSourceTest.java | Adds tests covering custom format patterns, hour override, hourly lookback behavior, and precedence rules. |
| gobblin-data-management/src/test/java/org/apache/gobblin/data/management/copy/iceberg/IcebergPartitionFilterGeneratorTest.java | Adds unit tests for generator behavior, immutability guarantees, and expression generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Outdated
Show resolved
Hide resolved
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Show resolved
Hide resolved
...ava/org/apache/gobblin/data/management/copy/iceberg/IcebergPartitionFilterGeneratorTest.java
Outdated
Show resolved
Hide resolved
...agement/src/test/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSourceTest.java
Outdated
Show resolved
Hide resolved
…management/copy/iceberg/IcebergSource.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…management/copy/iceberg/IcebergPartitionFilterGeneratorTest.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Blazer-007
reviewed
Mar 12, 2026
...in/java/org/apache/gobblin/data/management/copy/iceberg/IcebergPartitionFilterGenerator.java
Show resolved
Hide resolved
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Outdated
Show resolved
Hide resolved
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Outdated
Show resolved
Hide resolved
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Outdated
Show resolved
Hide resolved
Blazer-007
reviewed
Mar 16, 2026
Member
Blazer-007
left a comment
There was a problem hiding this comment.
Lets have a proper consistent format i.e. if filter date is provided then it should be in format of the pattern specified as well
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Outdated
Show resolved
Hide resolved
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Outdated
Show resolved
Hide resolved
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Outdated
Show resolved
Hide resolved
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Show resolved
Hide resolved
...-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergSource.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes Iceberg partition filtering fully configurable and reusable across all copy flows.
Previously the partition filter was hardcoded to append -00 for hourly tables and only supported yyyy-MM-dd or yyyy-MM-dd-HH patterns with a fixed daily lookback. This change generalizes the entire mechanism
New configs:
New utility: IcebergPartitionFilterGenerator
Extracted a pure, config-agnostic utility class with three public static methods:
This utility is fully decoupled from Gobblin config so it can be called from any flow, not just the copy pipeline.
Backward compatible: When iceberg.partition.value.format is absent, the legacy iceberg.hourly.partition.enabled path runs unchanged.
Test Plan