mihaibudiu opened a new pull request, #4044: URL: https://github.com/apache/calcite/pull/4044
This implementation adds support for checked arithmetic in Calcite. This solves some bugs which are at least 12 years old in Calcite, such as FNL_25. This implementation only handles pure arithmetic. Aggregates are not handled currently, but using the existing framework it should become very easy. The core idea is as follows: - add a set of checked arithmetic operators to StdSqlOperatorTable. There are five: plus, minus, divide, times, and unary minus. - add a new boolean property to the SqlConformance API: checkedArithmetic(). - if this property is true, the Prepare class will use a RelShuttle/RexShuttle to replace all arithmetic operations with their checked counterparts. The handling of Decimals is a bit different: there is not checked arithmetic for decimals, but casts to decimals perform overflow checking. As such, casts to decimals may not be elided from the program even if they seem noops (the input type matches the output type). -- 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]
