I have a cross join in my query. Here is the modified query :
create table abc.abcd as with temp1 as
(select
1 as bid, *
from
abc.data_1 ), temp2 as (select
1 as aid, *
from
abc.data_2 b), temp3 as ( select
a.*,
b.*
from temp2 a
join
temp1 b on a.aid=b.bid)
select * from temp3
The query is successfully completed in the redshift query history but the status of the query is still running in sqlworkbench/J.
Upon querying the newly created table, I am getting an error that object does not exist. I am using a 4 node dc2.large cluster. What could be going wrong here ?
UPDATE 1 : If I am running the same query but using a limit clause, the query returns the output just fine and the table is getting created.
Here is the query using limit clause:
create table abc.abcd as with temp1 as
(select
1 as bid, *
from
abc.data_1 ), temp2 as (select
1 as aid, *
from
abc.data_2 b), temp3 as ( select
a.*,
b.*
from temp2 a
join
temp1 b on a.aid=b.bid)
select * from temp3 limit 200