[Iceberg] Make timestamptz return new Timestamp.MICROS logical type#39344
[Iceberg] Make timestamptz return new Timestamp.MICROS logical type#39344ahmedabu98 wants to merge 10 commits into
Conversation
|
R: @claudevdm can you take a look? |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the IcebergIO connector to improve timestamp precision when reading Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
There was a problem hiding this comment.
Code Review
This pull request updates IcebergIO to read timestamptz columns as the Timestamp.MICROS Beam logical type to preserve microsecond precision, while providing backward compatibility via the --updateCompatibilityVersion option. The review feedback highlights two main improvements: first, using OffsetDateTime.parse(strValue).toInstant() in IcebergUtils to avoid DateTimeParseException when parsing strings with non-UTC timezone offsets; second, refactoring the new test in IcebergIOReadTest into two separate test methods to avoid sequential pipeline executions and properly utilize the TestPipeline rule.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| .put(SqlTypes.DATETIME.getIdentifier(), Types.TimestampType.withoutZone()) | ||
| .put(SqlTypes.UUID.getIdentifier(), Types.UUIDType.get()) | ||
| .put(MicrosInstant.IDENTIFIER, Types.TimestampType.withZone()) | ||
| .put(Timestamp.IDENTIFIER, Types.TimestampType.withZone()) |
There was a problem hiding this comment.
Will using timestamp logical type break xlang python reads?
There was a problem hiding this comment.
Hmmm yes it probably will... looks like we need to create the Python representation of Timestamp logical type first
| .put("gcp_project", OPTIONS.getProject()) | ||
| .put("gcp_location", "us-central1") | ||
| .put("warehouse", warehouse) | ||
| .put("io-impl", "org.apache.iceberg.gcp.gcs.GCSFileIO") |
There was a problem hiding this comment.
Running this IT locally was bringing up some HadoopFileIO issues. We should've had it running with GCSFileIO anyways (since we're working with a gs:// warehouse)
The new Timestamp logical type was added in #36705. This PR integrates it in IcebergIO and makes it the return type when reading
timestamptzIceberg columns. It's a breaking change, but we gate it with upgradeCompatibilityVersion pipeline optionThank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.