[fix](Nereids) decimal divide should not return null if numerator is zero (#22309)

This commit is contained in:
谢健
2023-07-27 20:23:04 +08:00
committed by GitHub
parent 687d97e648
commit 716d58f5ff
3 changed files with 5 additions and 1 deletions

View File

@ -584,7 +584,7 @@ public class NumericArithmetic {
*/
@ExecFunction(name = "divide", argTypes = {"DECIMALV3", "DECIMALV3"}, returnType = "DECIMALV3")
public static Expression divideDecimalV3(DecimalV3Literal first, DecimalV3Literal second) {
if (first.getValue().compareTo(BigDecimal.ZERO) == 0) {
if (second.getValue().compareTo(BigDecimal.ZERO) == 0) {
return new NullLiteral(first.getDataType());
}
DecimalV3Type t1 = (DecimalV3Type) first.getDataType();