FAILED: SemanticException [Error 10044]: Line 1:23 Cannot insert into target table because column...

来源:互联网 发布:淘宝申请退款次数 编辑:程序博客网 时间:2024/04/28 09:49

Insert table t1
Partition (country,province)
Select * from t2

country 和province根据select返回记录的相对位置进行复制, 分区字段是处于t1的末尾,所以也是t2的末尾赋值到t1

Insert table t1
Partition (country=”american”,province)
Select * from t2

当其中一个设置为静态分区后,那么country就不再 从select返回的取值,而province就会根据字段相对位置获取t2中country的字段,此时会导致返回的t2多出一个列,会如下的错
FAILED: SemanticException [Error 10044]: Line 1:23 Cannot insert into target table because column number/types are different ‘province’: Table insclause-0 has 5 columns, but query has 6 columns.

这种情况就需要将select 字句的*中去掉country

阅读全文
0 0
原创粉丝点击