# Projection of null in set operation. Illegal use of 'NULL'

**URL:** https://community.dremio.com/t/projection-of-null-in-set-operation-illegal-use-of-null/7124
**Category:** Uncategorized
**Created:** [March 14, 2021, 10:50pm UTC](https://community.dremio.com/t/projection-of-null-in-set-operation-illegal-use-of-null/7124 "2021-03-14T22:50:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dqmdev](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@dqmdev](https://community.dremio.com/u/dqmdev)
#### Post date: [March 14, 2021, 10:50pm UTC](https://community.dremio.com/t/projection-of-null-in-set-operation-illegal-use-of-null/7124/1 "2021-03-14T22:50:40Z")

</div>

Dremio server 14.0.0-202103011714040666-9a0c2e10  
Dremio JDBC 14.0.0-202103011714040666-9a0c2e10

Appears that the parser does not attempt to infer a type based on context. Have to explicitly cast the null value specification to a specific type. Scenarios, such as this are supported in other systems.

select rnum, 123 from cert.tbint  
union all  
select rnum, null from cert.tint

(org.apache.calcite.runtime.CalciteContextException) From line 3, column 14 to line 3, column 17: Illegal use of ‘NULL’  
sun.reflect.GeneratedConstructorAccessor236.newInstance():-1  
sun.reflect.DelegatingConstructorAccessorImpl.newInstance():45  
java.lang.reflect.Constructor.newInstance():423  
org.apache.calcite.runtime.Resources$ExInstWithCause.ex():463  
org.apache.calcite.sql.SqlUtil.newContextException():803  
org.apache.calcite.sql.SqlUtil.newContextException():788  
org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError():4478

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [March 15, 2021, 3:19am UTC](https://community.dremio.com/t/projection-of-null-in-set-operation-illegal-use-of-null/7124/2 "2021-03-15T03:19:56Z")

</div>

@dqmdev

As you rightly said, I see Postgres and MySQL handle it. I will file an internal bug on this. Thanks for reporting
