Is there sql WITH clause equivalent in hive?

hadoop, hive, sql

Solution

With is available in Hive as of version `0.13.0`. Usage documented here.

Problem

Failed to find the answer in the specs. So, I wonder: Can I do something like that in hive? ``` insert into table my_table with a as ( select * from ... where ... ), b as ( select * from ... where ... ) select a.a, a.b, a.c, b.a, b.b, b.c from a join b on (a.a=b.a); ```

Original source