Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Duplicate
-
1.9.2
-
None
-
None
-
- Apache Avro Version [1.10.0]
- Java Version [11]
Description
Steps to reproduce :
- Using the avro-compiler jar generate code with the following avsc:
{ "type": "record", "name": "Messages", "namespace": "com.somedomain", "fields": [ { "name": "not_optional_micros", "type": { "type": "long", "logicalType": "timestamp-micros" } }, { "name": "optional_date_micros", "type": [ "null", { "type": "long", "logicalType": "timestamp-micros" } ], "default": null } ] }
Actual results:
In the generated code, the conversion type added to the MODEL$ object incorrect. Timestamp*Millis*Conversion is added instead of TimestampMicrosConversion.
static { MODEL$.addLogicalTypeConversion(new org.apache.avro.data.TimeConversions.TimestampMillisConversion()); }
Expected results:
Based on the above avsc the following is expected.
static { MODEL$.addLogicalTypeConversion(new org.apache.avro.data.TimeConversions.TimestampMicrosConversion()); }
Attachments
Issue Links
- duplicates
-
AVRO-2471 Java maven plugin code generation doesn't add conversion for timestamp-micros
- Resolved