You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ryan Skraba (Jira)" <ji...@apache.org> on 2020/05/26 13:01:00 UTC

[jira] [Assigned] (AVRO-2836) SpecificCompiler does not add DecimalConversion when logical type is a Fixed type

     [ https://issues.apache.org/jira/browse/AVRO-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan Skraba reassigned AVRO-2836:
---------------------------------

    Assignee: Matthew McMahon

> SpecificCompiler does not add DecimalConversion when logical type is a Fixed type
> ---------------------------------------------------------------------------------
>
>                 Key: AVRO-2836
>                 URL: https://issues.apache.org/jira/browse/AVRO-2836
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java, logical types
>    Affects Versions: 1.9.2
>            Reporter: Matthew McMahon
>            Assignee: Matthew McMahon
>            Priority: Major
>         Attachments: AVRO-2836.patch
>
>
> I have updated to Avro 1.9.2 using the avro-maven-plugin to generate the specific types.
> This is working nicely, except noticed the case of:
> {code:java}
> "fields": [
>     {
>       "name": "unionOfFixedDecimal",
>       "type": ["null", {
>         "namespace": "org.apache.avro.codegentest.testdata",
>         "name": "FixedInUnion",
>         "type": "fixed",
>         "size": 12,
>         "logicalType": "decimal",
>         "precision": 28,
>         "scale": 15
>       }]
>     }] {code}
> This is a fixed type that has a logical type of decimal.
> When the source is generated, the type is BigDecimal. However the DecimalConversion is missing and then it breaks when used.
> It seems easy to workaround by manually adding the logical conversion before using.
> However the fix seems to be in SpecificCompiler#getClassNamesOfPrimitiveFields which is used by #getUsedConversionClasses



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