avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Wong (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1877) AVRO-1847 accidentally breaks javaUnbox method in SpecificCompiler
Date Sun, 10 Jul 2016 16:21:10 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15369707#comment-15369707

Michael Wong commented on AVRO-1877:

Hi Yibing, thanks for the quick reply. Honestly, I like the old code better. It's a lot more
efficient and less verbose. It doesn't convert from enum to String and then do a bunch of
String compares and return another String again. The extra test for UNION also smells like
a hack.

As for enableDecimalLogicalType. If truly the intent is to use converted logical types at
all, then this should be renamed to enableLogicalType. It's confusing to say it's for Decimal
but mean it for all.

More importantly, after applying your AVRO-1847, if you have date or timestamp-millis without
setting enableDecmialLogicalType, the compiled SpecificRecord code will NOT compile. Please
confirm for yourself. So we should do one of the following:

1. Decide that enableDecmialLogicalType means to apply to all logical types. Then rename it
to enableLogicalType and fix the code accordingly. (Most likely in conversionInstance, just
return null). Or,

2. Decide that enableDecimalLogicalType only applies to Decimal as before and not break compatability.
Then just fix javaType method as I pointed out above.

> 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-1877.2.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

View raw message