You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/01/25 08:22:00 UTC
[jira] [Updated] (PARQUET-1503) Remove Ints Utility Class
[ https://issues.apache.org/jira/browse/PARQUET-1503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated PARQUET-1503:
------------------------------------
Labels: pull-request-available (was: )
> Remove Ints Utility Class
> -------------------------
>
> Key: PARQUET-1503
> URL: https://issues.apache.org/jira/browse/PARQUET-1503
> Project: Parquet
> Issue Type: Improvement
> Affects Versions: 1.9.0
> Reporter: BELUGA BEHR
> Priority: Minor
> Labels: pull-request-available
>
> {code:java}
> public static int checkedCast(long value) {
> int valueI = (int) value;
> if (valueI != value) {
> throw new IllegalArgumentException(String.format("Overflow casting %d to an int", value));
> }
> return valueI;
> }
> {code}
> [Link Here|https://github.com/apache/parquet-mr/blob/dc61e510126aaa1a95a46fe39bf1529f394147e9/parquet-common/src/main/java/org/apache/parquet/Ints.java#L35]
> Now that the Parquet-MR project uses Java 1.8, this method can now be replaced with Java {{Math}} class and {{toIntExact}} method.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)