Hive - 从现有表创建外部表

时间:2016-05-27 00:20:06

标签: hive hiveql hadoop2

Hive - 从现有表创建外部表,如果无法完成...是否有解决方法。

我使用的hive版本是:Hive 1.2.1000.2.4.2.0-258

我想要运行的查询如下......

create external table table_1
stored as orc
location'wasb://vnextdev@1vnextstorage.blob.core.windows.net/output/table_1/'
tblproperties ("orc.compress"="SNAPPY")
as 
select * from table_0 limit 0;

在cwiki,他们解释为

CTAS有这些限制:

The target table cannot be a partitioned table.
The target table cannot be an external table.
The target table cannot be a list bucketing table.

复制以下链接。 https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTableAsSelect%28CTAS%29

谢谢: - )

1 个答案:

答案 0 :(得分:0)

还有另一种方法可以使用like关键字

创建配置单元表
create table target_table like source_table;
相关问题