Hive 如何使用CTA和配置单元中的位置创建与另一个表相同的表?

Hive 如何使用CTA和配置单元中的位置创建与另一个表相同的表?,hive,Hive,我写了一个查询:- create external table **table** LOCATION '**hdfs_folder**' as select column1, cloumn2,... from **another_table** where **where_condition** 如何在hive版本hive 0.12.0-cdh5.1.2中做到这一点?您可以使用创建类似表的语句来实现这一点,例如 CREATE EXTERNAL TABLE IF NOT EXISTS db_n

我写了一个查询:-

create external table **table** LOCATION '**hdfs_folder**' as 
select
column1, cloumn2,...
from **another_table**
where
**where_condition**

如何在hive版本hive 0.12.0-cdh5.1.2中做到这一点?

您可以使用
创建类似表的
语句来实现这一点,例如

CREATE EXTERNAL TABLE IF NOT EXISTS db_name.table_name
  LIKE existing_table_or_view_name
  LOCATION hdfs_path;
欲知详情