在修改之前某人写的hiveql时候执行一段代码时报这个错;
FAILED: ParseException line 13:4 missing KW_END at ',' near '<EOF>'
看了下sql没啥问题啊,就是报错呢,仔细瞅了半天,晕,知道啦!
原语句如下:
- insert overwrite table pcde.cd_chnnel
- select
- channel_id
- ,channel_name
- ,z_chn_org_unit_id
- ,depart_name1
- ,case when DEPART_NAME = '渠道中心' then DEPART_ID = 1
- when DEPART_NAME = '互联网金融部' then DEPART_ID = 2
- when DEPART_NAME = '互联网家庭部' then DEPART_ID = 3
- when DEPART_NAME = '电商平台与呼叫管理中心' then DEPART_ID = 4
- when DEPART_NAME = '客服部' then DEPART_ID = 5
- when DEPART_NAME = '其他' then DEPART_ID = 6
- ,depart_name
- from pcde.cd_chnnel_temp5
修改后语句如下:
- insert overwrite table pcde.cd_chnnel
- select
- channel_id
- ,channel_name
- ,z_chn_org_unit_id
- ,depart_name1
- ,case when DEPART_NAME = '渠道中心' then DEPART_ID = 1
- when DEPART_NAME = '互联网金融部' then DEPART_ID = 2
- when DEPART_NAME = '互联网家庭部' then DEPART_ID = 3
- when DEPART_NAME = '电商平台与呼叫管理中心' then DEPART_ID = 4
- when DEPART_NAME = '客服部' then DEPART_ID = 5
- when DEPART_NAME = '其他' then DEPART_ID = 6 end
- ,depart_name
- from pcde.cd_chnnel_temp5
你发现不同了吗哈哈哈
case 最后没加 end
真是醉了醉了,看来还是不够细心哈哈
我要醉了,瞅了半个多小时了,问题就这个啊 。。。。。。。。。。。。。。
@gaoyulei 哈哈,细心
文章不错支持一下
好文章!666,学习了