You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Pádraig de Buitléar (Jira)" <ji...@apache.org> on 2020/07/01 12:45:00 UTC

[jira] [Created] (AVRO-2876) TimestampMillisConversion added incorrectly to generated java for timestamp-micros logicalType

Pádraig de Buitléar created AVRO-2876:
-----------------------------------------

             Summary: TimestampMillisConversion added incorrectly to generated java for timestamp-micros logicalType
                 Key: AVRO-2876
                 URL: https://issues.apache.org/jira/browse/AVRO-2876
             Project: Apache Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.9.2
            Reporter: Pádraig de Buitléar


Steps to reproduce :
 # Using the avro-compiler jar generate code with the following avsc:
    

{code:java}
{
  "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
    }
      ]
}
{code}
 

*Actual results:*
 In the generated code, the conversion type added to the MODEL$ object incorrect. Timestamp*Millis*Conversion is added instead of *TimestampMicrosConversion*.
  
{code:java}
static {
    MODEL$.addLogicalTypeConversion(new org.apache.avro.data.TimeConversions.TimestampMillisConversion());
  }
{code}
 

*Expected results:*
 Based on the above avsc the following is expected.
  
{code:java}
  static {
    MODEL$.addLogicalTypeConversion(new org.apache.avro.data.TimeConversions.TimestampMicrosConversion());
  }
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)