Illegal use of 'NULL'


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

     col1 as res1,
     NULL as res2

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.



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.


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