Apache Software Foundation / SeaTunnel
Merged upstreamCorrectnessMerged Sep 18, 2026

Parse offset timestamps in Iceberg delete predicates

Made timestamp literal parsing schema-aware so Iceberg timestamp-with-zone predicates use offset parsing and the connector's existing microsecond conversion.

apache/seatunnel · #12286

Data-correctness fix

Iceberg custom delete predicates now resolve offset-bearing timestamp literals to the correct UTC instant for timestamptz columns.

Problem

The custom SQL parser used LocalDateTime for both Iceberg timestamp types, causing offset-bearing literals to fail with DateTimeParseException before a delete could run.

Approach

Parses UTC and positive or negative offsets for timestamptz comparisons and IN/NOT IN predicates. Offset-free literals keep their UTC interpretation; timestamp-without-zone columns and file-level delete restrictions remain unchanged.

Impact and scope

  • Enables correct instant-based deletes for offset-bearing timestamp literals instead of rejecting valid predicates.
  • Protects snapshot integrity when literals are invalid or a data file only partially matches the delete expression.
  • This is an Iceberg-specific follow-up and does not complete the broader timestamp-with-zone connector umbrella.

Validation

  • Tests cover UTC, positive/negative offsets, fractional precision, pre-epoch boundaries, IN/NOT IN, and invalid literals.
  • An in-memory Iceberg/Parquet integration test verifies the intended window is removed while adjacent and null records survive; invalid or partial-file predicates leave the snapshot unchanged.
  • Java 8 tests and Java 11 verify each passed 95 tests in a non-UTC JVM timezone, with one existing metastore skip. GitHub Build passed and the verified merge commit credits Goutam Adwant.
  • The catalog test is not a full Zeta or external Hive-metastore E2E test.