SemanticException分区spec {col = null}包含非分区列 [英] SemanticException Partition spec {col=null} contains non-partition columns

查看:5534
本文介绍了SemanticException分区spec {col = null}包含非分区列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  SET hive.exec.dynamic.partition = true ; 
SET hive.exec.dynamic.partition.mode = nonstrict;

如果不存在,创建外部表report_ipsummary_hourwise(
ip_address字符串,imp_date字符串,imp_hour bigint,geo_country字符串)
PARTITIONED BY(imp_date_P字符串,imp_hour_P字符串,geo_coutry_P字符串)
行格式分隔
字段以'\ t'结尾
以文本文件存储
位置's3:// abc';

插入覆盖表report_ipsummary_hourwise PARTITION(imp_date_P,imp_hour_P,geo_country_P)
选择ip_address,imp_date,imp_hour,geo_country,
imp_date作为imp_date_P,
imp_hour作为imp_hour_P,
geo_country as geo_country_P
FROM report_ipsummary_hourwise_Temp;

其中report_ipsummary_hourwise_Temp表包含以下列:
ip_address,imp_date,imp_hour,geo_country。 p>

我得到这个错误


SemanticException分区spec {imp_hour_p = null,imp_date_p = null,
geo_country_p = null}包含非分区列。

有人可以提出为什么会出现这个错误吗? p>

解决方案

你插入sql有 geo_country_P 列但目标表列名是 geo_coutry_P 。在国家


中错过 n

I am trying to create dynamic partitions in hive using following code.

SET hive.exec.dynamic.partition = true;
SET hive.exec.dynamic.partition.mode = nonstrict;

create external table if not exists report_ipsummary_hourwise(
ip_address string,imp_date string,imp_hour bigint,geo_country string)
PARTITIONED BY (imp_date_P string,imp_hour_P string,geo_coutry_P string) 
row format delimited 
fields terminated by '\t'
stored as textfile
location 's3://abc';

insert overwrite table report_ipsummary_hourwise PARTITION (imp_date_P,imp_hour_P,geo_country_P)
SELECT ip_address,imp_date,imp_hour,geo_country,
       imp_date as imp_date_P,
       imp_hour as imp_hour_P,
       geo_country as geo_country_P
FROM report_ipsummary_hourwise_Temp;

Where report_ipsummary_hourwise_Temp table contains following columns, ip_address,imp_date,imp_hour,geo_country.

I am getting this error

SemanticException Partition spec {imp_hour_p=null, imp_date_p=null, geo_country_p=null} contains non-partition columns.

Can anybody suggest why this error is coming ?

解决方案

You insert sql have the geo_country_P column but the target table column name is geo_coutry_P. miss a n in country

这篇关于SemanticException分区spec {col = null}包含非分区列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆