vroyer commented on pull request #10428:
URL: https://github.com/apache/pulsar/pull/10428#issuecomment-830464612


   Because the issue happens when creating the AVRO schema from a POJO class. 
Maybe a java annotation on BigDecimal fields could provide the scale ?
   
   > Le 30 avr. 2021 à 15:38, Enrico Olivelli ***@***.***> a écrit :
   > 
   > 
   > @eolivelli commented on this pull request.
   > 
   > In 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java:
   > 
   > > @@ -127,7 +127,12 @@ public static void 
addLogicalTypeConversions(ReflectData reflectData, boolean js
   >              }
   >          }
   >          reflectData.addLogicalTypeConversion(new 
Conversions.UUIDConversion());
   > -        reflectData.addLogicalTypeConversion(new 
Conversions.DecimalConversion());
   > +        reflectData.addLogicalTypeConversion(new 
Conversions.DecimalConversion() {
   > +            @Override
   > +            public org.apache.avro.Schema getRecommendedSchema() {
   > +                return 
LogicalTypes.decimal(100,51).addToSchema(org.apache.avro.Schema.create(org.apache.avro.Schema.Type.BYTES));
   > we already have "isJsr310ConversionEnabled" and "getAlwaysAllowNull"
   > why don't we store precision and scale the same way ? this way they will 
be stored in the registry and consumers will use the right version of the schema
   > 
   > —
   > You are receiving this because you were assigned.
   > Reply to this email directly, view it on GitHub, or unsubscribe.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to