wollowizard commented on code in PR #34024:
URL: https://github.com/apache/beam/pull/34024#discussion_r1964049275
##########
sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java:
##########
@@ -154,6 +158,15 @@ public class AvroUtils {
new ForLoadedType(ReadableInstant.class);
private static final ForLoadedType JODA_INSTANT = new
ForLoadedType(Instant.class);
+ private static final GenericData GENERIC_DATA_WITH_DEFAULT_CONVERSIONS;
+
+ static {
+ GENERIC_DATA_WITH_DEFAULT_CONVERSIONS = new GenericData();
+ addLogicalTypeConversions(GENERIC_DATA_WITH_DEFAULT_CONVERSIONS);
+ GENERIC_DATA_WITH_DEFAULT_CONVERSIONS.addLogicalTypeConversion(
+ new Conversions.DecimalConversion());
Review Comment:
in `addLogicalTypeConversions` I see this comment:
```
// do not add DecimalConversion by default as schema must have extra 'scale'
and 'precision'
// properties. avro reflect already handles BigDecimal as string with the
'java-class' property
```
so I suppose that's the reason. I see that this method is only used in
`org.apache.beam.sdk.extensions.avro.io.AvroDatumFactory.ReflectDatumFactory`
so that seems relevant
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]