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’)