Null Pointer error

I am getting a null pointer error without much other context. After narrowing it down it seems like this error occurs when using CTE tables and if the same source table or CTE table is referenced in a join. Not been able to get around this issue. Any suggestions
Sample query which runs into this issue, i have provided a simplified version that can simulate the error.

– NullPointerError
with CTE1 as
(
select Id, Col1, Col2
from <source table 1>
where Id in (1,2,3,4)
and Col1 in (‘foo’, ‘bar’)
)
SELECT Id, Col1, ColX, ColY
FROM <source table 1>
WHERE Id in (SELECT Col1 FROM CTE1)
and Col1 in (‘foobar’, ‘mbar’)

instead of use CTE, please try using VDS,
Dremio are more prepared to use VDS and not CTE

I am seeing similar problems.

Some of the queries I need are not possible to implement as VDS’s because I need to inject parameters from Tableau