damccorm commented on code in PR #39765:
URL: https://github.com/apache/beam/pull/39765#discussion_r4207913582
##########
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/transform/BeamBuiltinAggregations.java:
##########
@@ -90,7 +90,7 @@ public class BeamBuiltinAggregations {
.put("COUNTIF", typeName -> CountIf.combineFn())
.build();
- private static MathContext mc = new MathContext(10, RoundingMode.HALF_UP);
+ private static MathContext mc = new MathContext(34, RoundingMode.HALF_UP);
Review Comment:
`BeamRelDataTypeSystem.INSTANCE.getMaxNumericPrecision()` is `38`, so a
35–38 digit `DECIMAL` would still be rounded at 34 digits. Should we use `38`
here (and mark `mc` `final`) so that any valid `DECIMAL` precision in Beam SQL
is preserved on exact divisions?
```suggestion
private static final MathContext mc = new MathContext(38,
RoundingMode.HALF_UP);
```
--
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]