我怎样才能做到这一点?
hive> desc temp;
OK
a int
b int
Time taken: 0.077 seconds, Fetched: 2 row(s)
Run Code Online (Sandbox Code Playgroud)
我想创建列名为 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
Run Code Online (Sandbox Code Playgroud)
您无需再次提及表架构,因为您指定从另一个表获取架构。所以你的表创建语句应该是这样的
create table t2 as select a,b from temp;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3520 次 |
| 最近记录: |