Illegal use of 'NULL'

As already mentioned in a previous post, there is a serious issue with the usage of “NULL” in SELECT statements:

SELECT
     col1 as res1,
     NULL as res2
FROM
     somewhere.table

results in following error message:

Illegal use of ‘NULL’

Is this error message…

  • caused by calcite, arrow or dremio
  • intentionally (predetermined by architecture) or a bug?

Thank you.

Hi,

Dremio supports TYPED null literals, but not UNTYPED. So you could instead try:

SELECT CAST(NULL as INT) as res1 FROM somewhere.table.

Hope that helps.

2 Likes

Thank you for your quick reply!
That’s very helpful!