[ 
https://issues.apache.org/jira/browse/FLINK-23589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18034536#comment-18034536
 ] 

M Noronha commented on FLINK-23589:
-----------------------------------

I'd really like to see support for {{timestamp-micros}} and (ideally the new 
{{timestamp-nanos}}) format in AvroToRowDataConverters.
This is recommended by 
[https://iceberg.apache.org/docs/nightly/flink-writes/#write-with-avro-genericrecord]
 where iceberg support precision 6 + precision 9 data and something I'd really 
like to use through Flink.

The fixes from FLINK-33198 make things *almost* work for me - but what I found 
was that timestamp-micros parsed into in a GenericRecord as a `long` would be 
assumed to be millis from epochtime instead of the micros from epochtime and 
would result in incorrect data. Installing 
[TimestampMicrosConversion|https://github.com/apache/avro/blob/c39d0ac3276c55edc60615784f947293369ce624/lang/java/avro/src/main/java/org/apache/avro/data/TimeConversions.java#L160]
 helps get the date + time more correct but we loose precision because  
[https://github.com/apache/flink/blob/master/flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroToRowDataConverters.java#L218-L219]
 only uses the millis from the Instant. 

Is there anything I can I do to help get the PR reviewed?

> Support Avro Microsecond precision
> ----------------------------------
>
>                 Key: FLINK-23589
>                 URL: https://issues.apache.org/jira/browse/FLINK-23589
>             Project: Flink
>          Issue Type: Improvement
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
>            Reporter: Robert Metzger
>            Assignee: Marios Trivyzas
>            Priority: Major
>              Labels: pull-request-available, stale-assigned
>             Fix For: 2.2.0
>
>
> This was raised by a user: 
> https://lists.apache.org/thread.html/r463f748358202d207e4bf9c7fdcb77e609f35bbd670dbc5278dd7615%40%3Cuser.flink.apache.org%3E
> Here's the Avro spec: 
> https://avro.apache.org/docs/1.8.0/spec.html#Timestamp+%28microsecond+precision%29



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to