Skip to content

Flink: Nanosecond gaps in SortKeySerializer and ColumnStatsWatermarkExtractor#16268

Open
talatuyarer wants to merge 2 commits intoapache:mainfrom
talatuyarer:nanotimestamp-bug-fix
Open

Flink: Nanosecond gaps in SortKeySerializer and ColumnStatsWatermarkExtractor#16268
talatuyarer wants to merge 2 commits intoapache:mainfrom
talatuyarer:nanotimestamp-bug-fix

Conversation

@talatuyarer
Copy link
Copy Markdown
Contributor

I found a user-visible chain issue/bug.

  1. If user defines a partition spec with identity(ts_nano) or truncate(N, ts_nano).
  2. IcebergSink enables range distribution, calls Partitioning.sortOrderFor(spec) to derive a sort order.
  3. The sort order has a TIMESTAMP_NANO field.
  4. Flink shuffles records → serializes the sort key via SortKeySerializer → boom, UnsupportedOperationException.

In addition to that user case:

  1. User configures a Flink streaming source watermark on a TIMESTAMP_NANO column.
  2. ColumnStatsWatermarkExtractor constructor → boom, IllegalArgumentException because column type not in the allowlist.

Both are now fixed, and each fix has a test that would have failed against the old code. Patched Flink v2.1 nanosecond gaps in SortKeySerializer and ColumnStatsWatermarkExtractor, and added partition-transform tests.

fyi @pvary

…tsWatermarkExtractor, and added partition-transform tests
@github-actions github-actions Bot added the flink label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant