You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (Jira)" <ji...@apache.org> on 2021/10/01 12:16:00 UTC

[jira] [Commented] (FLINK-24420) Casting to a "narrower" type doesn't throw exception but follows Java overflow

    [ https://issues.apache.org/jira/browse/FLINK-24420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17423257#comment-17423257 ] 

Timo Walther commented on FLINK-24420:
--------------------------------------

+1 for this approach. Performance and Java-like by default but range checks if configured for correctness.

> Casting to a "narrower" type doesn't throw exception but follows Java overflow
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-24420
>                 URL: https://issues.apache.org/jira/browse/FLINK-24420
>             Project: Flink
>          Issue Type: Sub-task
>            Reporter: Marios Trivyzas
>            Priority: Major
>
> Ideally we should provide config option to be able to keep current behaviour where such casts follow the standard Java overflow, but in order to avoid "hidden" erroneous behaviour the user should be able to have an error thrown when an overflow happens. So basically range checks for each type like TINYINT, SMALLINT, INT, FLOAT should be enforced. Keep in mind of such range checks for every conversion would add performance overhead.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)