Serde: Impl Avro type for timestamp-nanos logical type #872
Labels
area/serde
Serialization & Deserialization (plugins)
good first issue
Up for grabs
scope/backend
Related to backend changes
status/triage/completed
Automatic triage completed
type/enhancement
En enhancement/improvement to an already existing feature
Issue submitter TODO list
Is your proposal related to a problem?
The UI doesn't currently support decoding an Avro
timestamp-nanos
logical type to JSON when it's displayed in the UI. It does support other (older) timestamp types such astimestamp-micros
though. The timestamp-nanos logical type fields are currently displayed as their underlyinglong
(nanoseconds since the Unix epoch).In the latest specification Avro 1.12.0 the new logical type timestamp-nanos (and local-timestamp-nanos) was added via [AVRO-3884].
Details:
Describe the feature you're interested in
It would be great to see
timestamp-nanos
values correctly decoded to a point in time, like timestamp-micros is presented, but with the necessary precision of course. Same should be done for thelocal-timestamp-nanos
logical type (local time instead of UTC).According to JsonAvroConversion.java as of today, there is support for timestamp-micros but not yet support for timestamp-nanos which would likely work very similar.
kafka-ui/api/src/main/java/io/kafbat/ui/util/jsonschema/JsonAvroConversion.java
Lines 442 to 463 in 1682872
Describe alternatives you've considered
Alternative to this feature is to take the presented integer value of the underlying long and offset it from the Unix epoch 'by hand'.
Version you're running
4cf17a0 (1.1.0)
Additional context
Unit tests should be added as well, code search for 'timestamp-micros' provides the relevant locations where tests for 'timestamp-nanos' would also be appropriate.
The text was updated successfully, but these errors were encountered: