[
https://issues.apache.org/jira/browse/AVRO-3164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17373548#comment-17373548
]
Artur Kalimullin commented on AVRO-3164:
----------------------------------------
I've just created new PR to solve the problem with deserializing stringables
using standard coders :)
I think that put method should respect schema and use the constructor to
deserialize value (which is a String, as expected). Without using constructor
currently it throws ClassCastException because String couldn't be assigned to
BigDecimal (and other stringable types).
I will create a separate ticket and PR for enabling custom coders by default.
> Allow stringable types deserialization if java-class is specified
> -----------------------------------------------------------------
>
> Key: AVRO-3164
> URL: https://issues.apache.org/jira/browse/AVRO-3164
> Project: Apache Avro
> Issue Type: New Feature
> Components: java
> Reporter: Artur Kalimullin
> Priority: Major
>
> Currently, compiler supports java-class and generates java classes with the
> given class. It works properly with serialization as toString() is being
> called, however, on deserialization compiler generates casting instead of
> calling a constructor with the string argument.
> It works with the ReflectData but not with the SpecificData which throws
> ClassCastException in runtime.
> To solve this, the same behaviour as ReflectData could be used (calling a
> constructor with a String argument)
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)