IMPALA-12565: Fix crash triggered by calling pmod() UDF

When the pmod() UDF is called, if the divisor is 0, it will
cause the impalad to crash. In this case, the result of the
pmod() UDF should be NULL.

Tests:
* add a test in exprs.test

Change-Id: Idcc274564a4b5b0872eb0c0c882c2f15e3247785
Reviewed-on: http://gerrit.cloudera.org:8080/20709
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
ttttttz
2023-11-15 23:01:48 +08:00
committed by Impala Public Jenkins
parent 19d2425bb0
commit ea86aef2f1
2 changed files with 10 additions and 2 deletions

View File

@@ -3286,4 +3286,12 @@ select bytes(string_col), bytes(date_string_col) from functional.alltypestiny;
1,8
---- TYPES
INT, INT
====
---- QUERY
# Test for IMPALA-12565 (UDF)
select pmod(0, 0), pmod(0, 0.0);
---- RESULTS
NULL,NULL
---- TYPES
BIGINT, DOUBLE
====