raminqaf commented on code in PR #29370:
URL: https://github.com/apache/flink/pull/29370#discussion_r4181936622
##########
flink-core/src/main/java/org/apache/flink/types/variant/BinaryVariantInternalBuilder.java:
##########
@@ -101,6 +101,9 @@ public class BinaryVariantInternalBuilder {
// UTF-32 hint and could turn input that is not valid JSON into a value.
private static final JsonFactory JSON_FACTORY =
new
JsonFactoryBuilder().disable(JsonFactory.Feature.CHARSET_DETECTION).build();
+ // The smallest unscaled magnitudes with more digits than a decimal4 or a
decimal8 holds.
+ private static final long DECIMAL4_UNSCALED_LIMIT = 1_000_000_000L;
+ private static final long DECIMAL8_UNSCALED_LIMIT =
1_000_000_000_000_000_000L;
Review Comment:
Changed to
```java
// An unscaled value fits DECIMAL4 or DECIMAL8 when its magnitude is
below 10^precision.
private static final long DECIMAL4_UNSCALED_LIMIT =
BigInteger.TEN.pow(MAX_DECIMAL4_PRECISION).longValueExact();
private static final long DECIMAL8_UNSCALED_LIMIT =
BigInteger.TEN.pow(MAX_DECIMAL8_PRECISION).longValueExact();
```
--
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]