Re: cast from bigdecimal to bigint throws ArithmeticException

2019-02-25 Thread Timothy Victor
This is more a Java question than Flink per se. But I believe you need to specify the rounding mode because it is calling longValueExact. If it just called longValue it would have worked without throwing an exceptionbut you risk overflowing 64 bits and getting a totally erroneous answer. Ar

cast from bigdecimal to bigint throws ArithmeticException

2019-02-25 Thread 徐涛
Hi Experts, There is a Flink table which has a column typed as java.math.BigDecimal, then in SQL I try to cast it to type long, cast(duration as bigint) however it throws the following exception: java.lang.ArithmeticException: Rounding necessary at java.math.BigDec

cast from bigdecimal to bigint throws ArithmeticException

2019-02-25 Thread 徐涛
Hi Experts, There is a Flink table which has a column typed as java.math.BigDecimal, then in SQL I try to cast it to type long, cast(duration as bigint) however it throws the following exception: java.lang.ArithmeticException: Rounding necessary at java.math.BigDec