Question: is subquery allowed in hive?
Answer: Hive supports subqueries only in the FROM clause (through Hive 0.12). The subquery has to be given a name because every table in a FROM clause must have a name. ... The columns in the subquery select list are available in the outer query just like columns of a table. The subquery can also be a query expression with UNION.