我们使用直接在另一个表上的INSERT-SELECT查询将数据加载到表中,如下所示
INSERT OVERWRITE TABLE <table1>
SELECT * FROM <table2> t2
WHERE <some-conditions>;类似地,如何加载具有复杂数据类型的表?如何让SELECT查询中的几个列为复杂的数据类型列贡献?我明白了吗?
table1的架构是
TABLE (col1 INT, col2 STRING, col3 ARRAY<STRING>)注意:将从文件加载到这样的表是可能的,但我只想尝试一下是否可以使用上面的INSERT-SELECT查询方式加载。感谢你的兴趣。
发布于 2013-12-01 19:20:17
蜂巢相当于插入..。select是下列之一:
1. from (table 2 query)
insert [overwrite] table <table1> [partition clause if partitioned table]或
2. create table table1 as select <table2 query>注意#2 (CTAS)不可靠。如果将#1与显式表创建或类似的操作结合起来,您会得到更好的服务:
create table <table1> **like** table2https://stackoverflow.com/questions/19804196
复制相似问题