Is there sql WITH clause equivalent in hive?
With is available in Hive as of version 0.13.0
. Usage documented here.
I guess you could always use subqueries:
insert into table my_table
select
a.a,
a.b,
a.c,
b.a,
b.b,
b.c
from
(
select *
from ...
where ...
) a
join
(
select *
from ...
where ...
) b
on a.a = b.a;