Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Since Hive supports SQL1999-style array types for columns, it would be nice for there to be a way to INSERT non-static data into such columns – i.e. from another table based on a complex query as opposed to loading from a static file, loading from hard-coded values within the INSERT query, or copying complete arrays verbatim from another table.
An example can be found at:
http://www.postgresql.org/message-id/20041028232152.GA76168@winnie.fuhr.org
CREATE TABLE table_a(a int, b int, c int[]);
INSERT INTO table_a
SELECT a, b, ARRAY(SELECT c FROM table_c WHERE table_c.parent = table_b.id)
FROM table_b
This should be implemented after regular correlated and uncorrelated subqueries are implemented:
https://issues.apache.org/jira/browse/HIVE-784 "Support uncorrelated subqueries in the WHERE clause"
https://issues.apache.org/jira/browse/HIVE-1799 "Support correlated subqueries in the WHERE clause"