gpt4 book ai didi

hive - 使用 "as select"或 "like"创建 hive 表并指定分隔符

转载 作者:行者123 更新时间:2023-12-03 07:23:43 25 4
gpt4 key购买 nike

是否可以做

create table <mytable> as select <query statement>

使用

row format delimited fields terminated by '|';

或者做一个

create table <mytable> like <other_table> row format delimited fields terminated by '|';

语言手册似乎表明不是......但有些东西让我很高兴,我过去已经实现了这一点。

最佳答案

Create Table as select (CTAS) is possible in Hive.

您可以尝试以下命令:

CREATE TABLE new_test 
row format delimited
fields terminated by '|'
STORED AS RCFile
AS select * from source where col=1
  1. 目标不能是分区表。
  2. 目标不能是外部表。
  3. 它复制结构和数据

Create table like is also possible in Hive.

  1. 它只是复制源表定义。

关于hive - 使用 "as select"或 "like"创建 hive 表并指定分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22249739/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com