I meet a similar issue that is the cast(decimal) function can not transfer the number to an expected precision in table API such as select(expressions). For transferring String to Expression I use the flink built-in function of parseExpression defined in ExpressionParser class.
---Original--- From: "LIU Xiao"<liuxiaogen...@gmail.com> Date: Mon, Aug 2, 2021 17:29 PM To: "user"<user@flink.apache.org>; Subject: How can I customize (BigDecimal) MathContext of flink-table-planner-blink? After upgrade Flink from 1.6 to 1.13 (flink-table-planner-blink), the result of our program changed: before: 10.38288597, after: 10.38288600 We used to use "tableEnv.config().setDecimalContext(new MathContext(MathContext.DECIMAL128.getPrecision(), RoundingMode.DOWN))" with Flink 1.6, but flink-table-planner-blink seems to just ignore the config and use RoundingMode.HALF_UP and maybe DECIMAL(38, 18) is alose not enough for us.