gpt4 book ai didi

hadoop - HIVE:CREATE TABLE AS SELECT 命令无法指定目标表的列列表

转载 作者:可可西里 更新时间:2023-11-01 16:23:12 25 4
gpt4 key购买 nike

我怎样才能让它工作?

  hive> desc temp;
OK
a int
b int
Time taken: 0.077 seconds, Fetched: 2 row(s)

我想创建列名为 c 和 d 的 t2 HIVE 表,但出现以下错误。

  hive> create table t2(c int,d int) as select a,b from temp;
FAILED: SemanticException [Error 10065]: CREATE TABLE AS SELECT command cannot specify the list of columns for the target table

最佳答案

您无需再次提及表架构,因为您指定要从另一个表中获取架构。所以你的建表语句应该是这样的

create table t2 as select a,b from temp;

关于hadoop - HIVE:CREATE TABLE AS SELECT 命令无法指定目标表的列列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43178920/

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