【问题标题】:Hive - create an external table from an existing tableHive - 从现有表创建外部表
【发布时间】:2016-09-25 04:09:25
【问题描述】:

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

谢谢你:-)

【问题讨论】:

  • 您在运行上述查询时是否遇到任何错误?

标签: hive hiveql hadoop2


【解决方案1】:

还有另一种方法可以使用 like 关键字创建 hive 表

create table target_table like source_table;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-07
    • 1970-01-01
    相关资源
    最近更新 更多