You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/06/15 12:55:00 UTC
[jira] [Work logged] (AVRO-3536) Union type not inheriting type conversions
[ https://issues.apache.org/jira/browse/AVRO-3536?focusedWorklogId=781630&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-781630 ]
ASF GitHub Bot logged work on AVRO-3536:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jun/22 12:54
Start Date: 15/Jun/22 12:54
Worklog Time Spent: 10m
Work Description: im-pratham opened a new pull request, #1721:
URL: https://github.com/apache/avro/pull/1721
Updated the getForSchema to also consider Union types
Issue Time Tracking
-------------------
Worklog Id: (was: 781630)
Remaining Estimate: 0h
Time Spent: 10m
> Union type not inheriting type conversions
> ------------------------------------------
>
> Key: AVRO-3536
> URL: https://issues.apache.org/jira/browse/AVRO-3536
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.11.0
> Reporter: Prathamesh
> Priority: Major
> Attachments: Test1.avsc
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The attached schema has top-level AVRO Union type. Whenever the client tries to deserialize the message it fails at parsing field - opt_amount, with stack trace -
> {code:java}
> Caused by: java.lang.ClassCastException: class java.nio.HeapByteBuffer cannot be cast to class java.math.BigDecimal (java.nio.HeapByteBuffer and java.math.BigDecimal are in module java.base of loader 'bootstrap')
> at io.confluent.base.model.Test1.put(Test1.java:115)
> at org.apache.avro.generic.GenericData.setField(GenericData.java:837)
> at org.apache.avro.specific.SpecificDatumReader.readField(SpecificDatumReader.java:139)
> at org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:248)
> at org.apache.avro.specific.SpecificDatumReader.readRecord(SpecificDatumReader.java:123)
> at org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:180)
> at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:161)
> at org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:188)
> at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:161)
> at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:154)
> at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer$DeserializationContext.read(AbstractKafkaAvroDeserializer.java:400) {code}
> The sample message you can try is -
> {code:java}
> { "io.confluent.base.model.Test1": { "opt_amount": { "bytes": "10.2" } } } {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)