使用“as select”创建配置单元表或“喜欢”并指定分隔符 [英] Create hive table using "as select" or "like" and also specify delimiter
问题描述
是否可以执行
create table< mytable> as select< query statement>
使用
以'|'结尾的行格式定界字段;
或做一个
创建表格< mytable>如< other_table>以'|'结尾的行格式定界字段
语言手册似乎表明不是..但有些事情让我感到痒,
在Hive中可以创建表为select(CTAS)。
您可以尝试以下命令:
<$ p $ CREATE TABLE new_test
行格式定界
字段以'|'结尾
STORED AS RCFile
AS select * from source where col = 1
- 目标不能为分区表。
- 目标不能是外部表。
- 它复制结构以及数据
- 它仅复制源表定义。
- Target cannot be partitioned table.
- Target cannot be external table.
- It copies the structure as well as the data
- It just copies the source table definition.
在Hive中也可以创建表。
Is it possible to do a
create table <mytable> as select <query statement>
using
row format delimited fields terminated by '|';
or to do a
create table <mytable> like <other_table> row format delimited fields terminated by '|';
The Language Manual seems to indicate not.. but something tickles me I had achieved this in the past.
Create Table as select (CTAS) is possible in Hive.
You can try out below command:
CREATE TABLE new_test
row format delimited
fields terminated by '|'
STORED AS RCFile
AS select * from source where col=1
Create table like is also possible in Hive.
这篇关于使用“as select”创建配置单元表或“喜欢”并指定分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!