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

Yibing Shi commented on AVRO-1847:
----------------------------------

Since we always try to use Joda or Java classes for date/time types, I prefer 
not to add a new flag. Instead, I just check the whether the the logical type 
is one of the date/time types. If yes, I apply the conversions if they are 
present.
{code}
  public String javaType(Schema schema) {
    if (useLogicalTypesForNonDateTimeTypes
        || LogicalTypes.isDateTimeType(schema.getLogicalType())) {
      Conversion<?> conversion = SPECIFIC
          .getConversionFor(schema.getLogicalType());
      if (conversion != null) {
        return conversion.getConvertedType().getName();
      }
    }
{code}

> IDL compiler uses ByteBuffer for decimal type even if logical type is 
> supported 
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-1847
>                 URL: https://issues.apache.org/jira/browse/AVRO-1847
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.0
>            Reporter: Yibing Shi
>            Assignee: Yibing Shi
>         Attachments: AVRO-1847.1.patch, AVRO-1847.2.patch, AVRO-1847.3.patch, 
> AVRO-1847.4.patch
>
>
> Version 1.8.0 has added the support of logical types. A conversion class 
> (Conversions.DecimalConversion) has also been added for decimal type. 
> However, the IDL compiler still uses ByteBuffer for decimal types, which is 
> not the same behaviour as data, time or timestamp type (added in AVRO-1684). 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to