[
https://issues.apache.org/jira/browse/AVRO-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15327762#comment-15327762
]
Sean Busbey commented on AVRO-1847:
-----------------------------------
{code}
diff --git
a/lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
b/lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
index 775a8cb..4905302 100644
--- a/lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
+++ b/lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
...
/* LITERALS */
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? y
@@ -1488,6 +1489,19 @@ Schema PrimitiveType():
| "date" { return LogicalTypes.date().addToSchema(Schema.create(Type.INT)); }
| "time_ms" { return
LogicalTypes.timeMillis().addToSchema(Schema.create(Type.INT)); }
| "timestamp_ms" { return
LogicalTypes.timestampMillis().addToSchema(Schema.create(Type.LONG)); }
+| "decimal" { return DecimalTypeProperties(); }
+}
+
+Schema DecimalTypeProperties():
+{
+ int pricision;
+ int scale;
+}
+{
+ "(" {pricision = Json().asInt();} "," {scale = Json().asInt();} ")"
+ {
+ return LogicalTypes.decimal(pricision,
scale).addToSchema(Schema.create(Type.BYTES));
+ }
{code}
please rename "pricision" to "precision"
> 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)