The Core Mining Engine team plans to roll out a behavior change for the CASE WHEN operator in PQL.
Why are we planning this?
The current CASE WHEN behavior is not intuitive and contradicts the behavior of established SQL systems. The new behavior can simply be thought of as "NULL is treated as false". More information and details can be found here.
What will change?
When using an ELSE fallback condition, so far the rows evaluating to NULL would be returned as NULL even if the ELSE statement was correctly defined. Example, when <COLUMN> = ‘A’ evaluates to NULL, then the following statement
CASE
WHEN <COLUMN> = ‘A’ THEN ‘option A’
ELSE ‘other’
END
returns NULL instead of ‘other’. This counterintuitive behavior will change: CASE WHEN will return ‘other’ with NULL inputs. This will lead to less NULL results and more ELSE results if NULL values are input values, and if ELSE is being used. If no ELSE is defined or if ELSE NULL is used, the result will still be NULL and nothing will change.
What are the next steps?
The plan is to gradually roll out the change beginning in February 2022.