Skip to content

Flink: Cherry-pick #17194 and its v1.20/v2.0 backport - Fix timestamp-micros conversion in AvroToRowDataConverters - #12

Merged
nickwu241 merged 2 commits into
1.11.0-affirm-patchfrom
nick/cherry-pick-17194-ts-micros
Sep 25, 2026
Merged

nickwu241 merged 2 commits into
1.11.0-affirm-patchfrom
nick/cherry-pick-17194-ts-micros

Conversation

@nickwu241

@nickwu241 nickwu241 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Cherry-picks apache#17194 onto 1.11.0-affirm-patch, covering flink/v2.1, flink/v1.20, and flink/v2.0.

AvroToRowDataConverters.convertToTimestamp's precision <= 6 branch multiplied the sub-millisecond remainder by 1_000_000 instead of 1000, producing an out-of-range nanoOfMillisecond and throwing IllegalArgumentException for any MicroTimestamp/ZonedTimestamp value with a nonzero microsecond remainder. Existing tests never caught it because their fixtures used a zero remainder.

Filed upstream as apache#17075 (closed), fixed by apache#17194, with a same-day backport apache#17212 to flink/v1.20/flink/v2.0. Neither the apache-iceberg-1.11.0 tag nor this fork had picked up either commit.

Commits

  1. flink/v2.1 cherry-pick — direct cherry-pick of Flink: Fix timestamp-micros conversion in AvroToRowDataConverters apache/iceberg#17194 (apache/iceberg@a466c3d).
  2. flink/v1.20 + flink/v2.0 backport — direct cherry-pick of upstream's own backport of this fix, Flink: Backport timestamp-micros conversion fix to 1.20 and 2.0 apache/iceberg#17212 (apache/iceberg@dc0b59c).

Both cherry-picks applied cleanly, no conflicts.

Verification

./gradlew -DflinkVersions=2.0 :iceberg-flink:iceberg-flink-2.0:test --tests 'org.apache.iceberg.flink.sink.TestAvroGenericRecordToRowDataMapper'
BUILD SUCCESSFUL — 13 tests, 0 failures (includes testPrimitiveTypes, which now exercises the corrected DataGenerators fixture with a nonzero microsecond remainder)

@github-actions github-actions Bot added the FLINK label Sep 24, 2026
Signed-off-by: Sergei Nikolaev <kinolaev@gmail.com>
(cherry picked from commit a466c3d)
Signed-off-by: Sergei Nikolaev <kinolaev@gmail.com>
(cherry picked from commit dc0b59c)
@nickwu241
nickwu241 force-pushed the nick/cherry-pick-17194-ts-micros branch from 533a359 to 72cd505 Compare September 24, 2026 19:33
@nickwu241 nickwu241 changed the title Flink: Fix timestamp-micros conversion in AvroToRowDataConverters (cherry-pick apache/iceberg#17194) Flink: Cherry-pick #17194 and its v1.20/v2.0 backport - Fix timestamp-micros conversion in AvroToRowDataConverters Sep 24, 2026

@dcagney dcagney left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approving — verified against upstream apache#17194 (fix) + apache#17212 (backport). Diff is byte-for-byte identical across flink/v1.20, v2.0, v2.1.

Checked specifically for hidden dependency on unbackported upstream work: confirmed our fork's pre-patch state exactly matches upstream's pre-patch state at the parent commits of apache#17194/apache#17212 (zero drift in AvroToRowDataConverters.java / DataGenerators.java), so this cherry-pick applies cleanly with no missing prerequisite.

LGTM.

@nickwu241
nickwu241 merged commit cda261c into 1.11.0-affirm-patch Sep 25, 2026
22 of 26 checks passed
nickwu241 added a commit that referenced this pull request Sep 25, 2026
Bumps version.txt and adds the AFFIRM_VERSIONS.md changelog entry for the next
patch release, covering the 3 review-triggered fixes from all-the-things#222721
(#12/#13/#14). Those PRs are open, not yet merged — rebase this branch onto
1.11.0-affirm-patch once they land, then tag 1.11.0-affirm-patch.2 at the
resulting commit and publish per RUNBOOK_ICEBERG_PATCH_PUBLISH.md.
nickwu241 added a commit that referenced this pull request Sep 25, 2026
* Document and stage 1.11.0-affirm-patch.2

Bumps version.txt and adds the AFFIRM_VERSIONS.md changelog entry for the next
patch release, covering the 3 review-triggered fixes from all-the-things#222721
(#12/#13/#14). Those PRs are open, not yet merged — rebase this branch onto
1.11.0-affirm-patch once they land, then tag 1.11.0-affirm-patch.2 at the
resulting commit and publish per RUNBOOK_ICEBERG_PATCH_PUBLISH.md.

* Update AFFIRM_VERSIONS.md: base off 1.11.0-affirm-patch.1, drop reviewer names

* Drop #10/#11 from .2 table (already covered by .1 base)

* Note #12/#13/#14 merged and branch rebased; ready to tag

* Drop 'not yet published' framing now that .2 contents are final

* Drop trailing note from .2 section to match .1 format
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.

3 participants