thswlsqls opened a new pull request, #17078:
URL: https://github.com/apache/iceberg/pull/17078

   
   Closes #17075
   
   ## Summary
   
   - `AvroToRowDataConverters.convertToTimestamp()` multiplied the leftover 
sub-millisecond microseconds by `1_000_000` instead of `1000` before passing 
them as `nanoOfMillisecond` to `TimestampData.fromEpochMillis(long, int)`.
   - `TimestampData`'s constructor requires `nanoOfMillisecond` in `[0, 
999999]`; any non-zero leftover microsecond value overflowed that bound, 
throwing `IllegalArgumentException` on read.
   - Matches sibling conversions that already scale by `1000`: 
`StructRowData.getTimestamp()` and 
`FlinkValueReaders.TimestampMicrosReader.read()`.
   - Introduced by PR #15475 (nanosecond precision support); only the 
microsecond (`precision <= 6`) path is affected, not the nanosecond path.
   
   ## Testing done
   
   - Added `TestAvroToRowDataConverters#microsWithSubMillisecondComponent` and 
`#microsAlignedToMillisecond` — the first fails with `IllegalArgumentException` 
before this fix and passes after; the second (millisecond-aligned input) passes 
both before and after, confirming no regression.
   - `./gradlew :iceberg-flink:iceberg-flink-2.1:test --tests 
TestAvroToRowDataConverters --tests TestAvroGenericRecordToRowDataMapper 
--tests TestFlinkAvroReaderWriter` — all passed, covering the new test and 
other Avro-conversion call sites.
   - `./gradlew :iceberg-flink:iceberg-flink-2.1:spotlessCheck 
:iceberg-flink:iceberg-flink-2.1:checkstyleMain 
:iceberg-flink:iceberg-flink-2.1:checkstyleTest` — passed. The module's full 
`:check` (MiniCluster-based) was skipped due to its runtime; the targeted tests 
above cover the change and its call sites.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to