Description
For example, query:
select nvl('1', 2)
Fails with:
Cannot infer return type for NVL; operand types: [CHAR(1), INTEGER]
Query:
select decode('1', 1, '1', '2')
Fails with:
while resolving method 'eq[class java.lang.String, int]' in class class org.apache.calcite.runtime.SqlFunctions
These functions are rewritten to the CASE-WHEN operator after the validation, but fail on validation. But if we use CASE-WHEN in the original query, it works well, types are casted correctly and validation passed:
select case when '1' is not null then '1' else 2 end select case when '1' = 1 then '1' else '2' end
Attachments
Issue Links
- is a clone of
-
IGNITE-23673 Calcite engine. Functions NVL and DECODE fail when used with parameters of different data types
- Resolved