pvary commented on code in PR #14245:
URL: https://github.com/apache/iceberg/pull/14245#discussion_r2405264615
##########
flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/StructRowData.java:
##########
@@ -186,7 +186,13 @@ private BigDecimal getDecimalInternal(int pos) {
@Override
public TimestampData getTimestamp(int pos, int precision) {
long timeLong = getLong(pos);
- return TimestampData.fromEpochMillis(timeLong / 1000, (int) (timeLong %
1000) * 1000);
+ if (precision == 9) {
+ // For nanosecond precision, preserve the full nanosecond value
+ return TimestampData.fromEpochMillis(timeLong / 1_000_000L, (int)
(timeLong % 1_000_000L));
+ } else {
+ // For microsecond precision, use the original logic
+ return TimestampData.fromEpochMillis(timeLong / 1000, (int) (timeLong %
1000) * 1000);
+ }
Review Comment:
Should we handle where precision is different than 9, and 6?
--
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]