Skip to content

Flink: Fix timestamp-micros conversion in AvroToRowDataConverters#17194

Merged
pvary merged 1 commit into
apache:mainfrom
kinolaev:fix-flink-avro-ts-micro
Jul 15, 2026
Merged

Flink: Fix timestamp-micros conversion in AvroToRowDataConverters#17194
pvary merged 1 commit into
apache:mainfrom
kinolaev:fix-flink-avro-ts-micro

Conversation

@kinolaev

@kinolaev kinolaev commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Avro timestamp-micros values were converted to TimestampData by multiplying the microsecond remainder by 1_000_000 instead of 1000, producing an out-of-range nanoOfMillisecond and throwing IllegalArgumentException. Tests didn't catch it because microsecond remainder was 0. I added a non-zero microsecond component to DataGenerators' shared timestamp fixture.

Closes #17075.

@github-actions github-actions Bot added the flink label Jul 14, 2026
@pvary

pvary commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

is this the same one as #17078?

We need a test to prevent regression which fails before the patch, and succeeds after the patch.
Also please create a PR for Filnk 2.1 first, and after that PR got merged, then create a backport PR which contains the same changes to Flink 2.0, and Flink 1.20.

Thanks,
Peter

Signed-off-by: Sergei Nikolaev <kinolaev@gmail.com>
@kinolaev kinolaev force-pushed the fix-flink-avro-ts-micro branch from 054ce4f to a466c3d Compare July 14, 2026 13:42
@kinolaev

Copy link
Copy Markdown
Contributor Author

You are right @pvary, I'm sorry - this is the same as #17078.

The test org.apache.iceberg.flink.sink.TestAvroGenericRecordToRowDataMapper fails before the patch because org.apache.iceberg.flink.DataGenerators now produces timestamps with a non-zero microsecond component.

I have removed the changes to v1.20/v2.0. I'll keep this PR open in case you prefer to merge this one instead of #17078 for any reason.

@pvary pvary merged commit 4eb37b0 into apache:main Jul 15, 2026
25 checks passed
@pvary

pvary commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Merged to main.
Thanks @kinolaev for the fix!

Please create the backport PR.

@kinolaev

Copy link
Copy Markdown
Contributor Author

Thanks @pvary ! Here is the backport PR #17212. All checks have already passed.

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.

Flink: AvroToRowDataConverters throws IllegalArgumentException for microsecond timestamps

2 participants