Queries with multiple UDFs may crash on systems with high load if it least one of the UDFs does not receive any actual data
Details
| Detail name | Value |
|---|---|
| Changelog Number | 5707 |
| Type | Bug |
| Status | Resolved |
| Affected Versions | EXASOL 6.0.0 |
| Fix Versions | EXASOL 6.0.7 |
| Resolution Date | 2018-02-05 |
Problem
Given a system under high load.
Then queries containing multiple UDFs may crash if at least one of the UDFs is never given any data.
Example
create or replace python scalar script p(x int) returns int as import time def run(ctx): return ctx.x / create or replace table ten as (values 0,1,2,3,4,5,6,7,8,9 as p(x)); create or replace table t1(x0 int, x1 int, x2 int, x3 int, x4 int, x5 int, x6 int, x7 int, x8 int, x9 int); insert into t1 select 0,NULL,NULL,NULL,4,5,6,7,8,9 from ten,ten,ten; -- This query might crash: select p(x0),case when x1 is null then null else p(x1) end,p(x2),p(x3),p(x4),p(x5),p(x6),p(x7),p(x8),p(x9) from t1;
Explanation
The crucial part is the CASE statement and the fact that column x1 only contains NULL. Then p(x1) is never evaluated and this triggers the problem (for systems with very high load)
Possible Workaround
If the UDF has the property that NULLs are preserved (like in the example above where p(NULL) will result in NULL), the CASE statement could be removed and replaced by a call to the UDF.