Skip to content

fix(glue): map Timestamptz/TimestamptzNs to Glue timestamp types - #2956

Open
dor-bernstein wants to merge 3 commits into
apache:mainfrom
dor-bernstein:fix/glue-timestamptz-conversion
Open

fix(glue): map Timestamptz/TimestamptzNs to Glue timestamp types#2956
dor-bernstein wants to merge 3 commits into
apache:mainfrom
dor-bernstein:fix/glue-timestamptz-conversion

Conversation

@dor-bernstein

Copy link
Copy Markdown

Problem

When compacting (or otherwise writing metadata for) an Iceberg table that has
Timestamptz or TimestamptzNs columns, the Glue catalog schema serializer
returns FeatureUnsupported:

FeatureUnsupported => Conversion from Timestamptz is not supported

This error surfaces in iceberg_compaction_core::compaction at the commit
phase — after all data files have already been successfully rewritten — making
the entire operation fail and the rewrite work wasted.

Root cause: GlueSchemaBuilder::primitive() in
crates/catalog/glue/src/schema.rs has no match arms for
PrimitiveType::Timestamptz and PrimitiveType::TimestamptzNs, so they fall
through to an explicit FeatureUnsupported error.

Fix

Map Timestamptz"timestamp" and TimestamptzNs"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

cargo test -p iceberg-catalog-glue

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.
Comment on lines -161 to -162
return Err(Error::new(
ErrorKind::FeatureUnsupported,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a clippy unused imports warning, probably because we aren't using Error and ErrorKind anymore.

Comment thread crates/catalog/glue/src/schema.rs Outdated
));
}
// Glue has no timezone-aware timestamp type; map to the equivalent non-tz type,
// matching the behavior of Spark's Glue catalog integration.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically not in Spark's integration. It's part of the AWS module of apache/iceberg.

Comment thread crates/catalog/glue/src/schema.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use iceberg::Result;

dor-bernstein and others added 2 commits August 5, 2026 10:38
- 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>
@dor-bernstein
dor-bernstein requested a review from anoopj August 5, 2026 08:16
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