fix(glue): map Timestamptz/TimestamptzNs to Glue timestamp types - #2956
Open
dor-bernstein wants to merge 3 commits into
Open
fix(glue): map Timestamptz/TimestamptzNs to Glue timestamp types#2956dor-bernstein wants to merge 3 commits into
dor-bernstein wants to merge 3 commits into
Conversation
Glue has no timezone-aware timestamp type. Previously, schemas containing Timestamptz or TimestamptzNs columns returned FeatureUnsupported during catalog operations (e.g. committing rewrites), causing failures for any table with timestamp-with-timezone fields. Map Timestamptz -> "timestamp" and TimestamptzNs -> "timestamp_ns", matching the behavior of Spark's Glue catalog integration which also drops timezone information when serializing to the Glue type system. Adds a regression test covering both Timestamptz and TimestamptzNs fields.
anoopj
reviewed
Aug 4, 2026
Comment on lines
-161
to
-162
| return Err(Error::new( | ||
| ErrorKind::FeatureUnsupported, |
Member
There was a problem hiding this comment.
there is a clippy unused imports warning, probably because we aren't using Error and ErrorKind anymore.
| )); | ||
| } | ||
| // Glue has no timezone-aware timestamp type; map to the equivalent non-tz type, | ||
| // matching the behavior of Spark's Glue catalog integration. |
Member
There was a problem hiding this comment.
This is technically not in Spark's integration. It's part of the AWS module of apache/iceberg.
Member
There was a problem hiding this comment.
Suggested change
| use iceberg::Result; |
- Drop Error and ErrorKind from iceberg import (unused after removing the FeatureUnsupported arm) — fixes clippy unused_imports warning - Update comment to reference apache/iceberg AWS Glue module instead of Spark's integration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problem
When compacting (or otherwise writing metadata for) an Iceberg table that has
TimestamptzorTimestamptzNscolumns, the Glue catalog schema serializerreturns
FeatureUnsupported:This error surfaces in
iceberg_compaction_core::compactionat the commitphase — after all data files have already been successfully rewritten — making
the entire operation fail and the rewrite work wasted.
Root cause:
GlueSchemaBuilder::primitive()incrates/catalog/glue/src/schema.rshas no match arms forPrimitiveType::TimestamptzandPrimitiveType::TimestamptzNs, so they fallthrough to an explicit
FeatureUnsupportederror.Fix
Map
Timestamptz→"timestamp"andTimestamptzNs→"timestamp_ns",matching the behaviour of Spark's Glue catalog integration which also drops
timezone information when serializing to Glue's type system (Glue has no
timezone-aware timestamp type).
A regression test is added covering both new mappings.
Testing