Full type deduction for nulls in tuples
Details
| Detail name | Value |
|---|---|
| Changelog Number | 9092 |
| Type | Improvement |
| Status | Resolved |
| Fix Versions | Exasol 7.1.0 |
| Resolution Date | 2021-08-03 |
Problem
Starting with version 6.2.3, Exasol deduces the type of NULL in tuples based on constants. Its type deduction does not support expressions. This can lead to type errors.
Example:
SELECT * FROM VALUES ((1+1, TRUE), (NULL, FALSE)) AS t(i, b);
Workaround
It is possible to cast the null to the desired data type.
Example:
SELECT * FROM VALUES ((1+1, TRUE), (CAST(NULL AS INT), FALSE)) AS t(i, b);
Problem
Up to version 6.2.3, Exasol assumes that the type of NULL in tuples is BOOLEAN. This can cause type errors.
Example:
SELECT * FROM VALUES ((1, TRUE), (NULL, FALSE)) AS t(i, b);
Workaround
It is possible to cast the null to the desired data type.
Example:
SELECT * FROM VALUES ((1, TRUE), (CAST(NULL AS CHAR(1)), FALSE)) AS t(i, b);
With a full and fast type deduction such queries would not require casts.