[
https://issues.apache.org/jira/browse/AVRO-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15369631#comment-15369631
]
Yibing Shi commented on AVRO-1877:
----------------------------------
{quote}
The way you call javaType from javaUnbox in this latest patch is not correct.
For example, if you have a {{union \{null, double\}}}, javaType() will turn it
into a boxed java.lang.Double that is nullable. Your changes to javaUnbox will
then incorrectly convert that to a primitive type double. My suggestion is to
revert to the old code and maybe refactor the duplicate SPECIFIC conversion
part into a separate method.
{quote}
Very good point! I will correct this. Thanks for the idea!
{quote}
The problem is that enableDecimalLogicalType only applies to the Decimal
logical type. For the other logical types, such as date or timestamp-millis,
they would be converted even if you didn't enableDecimalLogicalType.
{quote}
This is done on purpose. It is to keep backwards compatibility with 1.8.0. When
date/time logical types were added in 1.8.0, they always use logical types
instead of backing raw types in SpecificRecord. Please see [this
comment|https://issues.apache.org/jira/browse/AVRO-1847?focusedCommentId=15327757&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15327757]
for more details.
> AVRO-1847 accidentally breaks javaUnbox method in SpecificCompiler
> ------------------------------------------------------------------
>
> Key: AVRO-1877
> URL: https://issues.apache.org/jira/browse/AVRO-1877
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.9.0
> Reporter: Yibing Shi
> Priority: Blocker
> Attachments: AVRO-1877.1.patch
>
>
> AVRO-1847 accidentally removes the logical type conversion logic in method
> {{SpecificCompiler.javaUnbox}}, which breaks the data time type compiling in
> specific compiler.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)