gpt4 book ai didi

hadoop - 字符串连接在 pig 中不起作用

转载 作者:可可西里 更新时间:2023-11-01 14:41:07 27 4
gpt4 key购买 nike

我在 hcatalog 中有一个表,它有 3 个字符串列。当我尝试连接字符串时,出现以下错误:

A = LOAD 'default.temp_table_tower' USING org.apache.hcatalog.pig.HCatLoader() ;
B = LOAD 'default.cdr_data' USING org.apache.hcatalog.pig.HCatLoader();
c = FOREACH A GENERATE CONCAT(mcc,'-',mnc) as newCid;

Could not resolve concat using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

Could not infer the matching function for org.apache.pig.builtin.CONCAT as multiple or none of them fit. Please use an explicit cast

问题的根本原因可能是什么?

最佳答案

可能对 pig 中的连接有帮助

data1 包含:

(Maths,abc)
(Maths,def)
(Maths,ef)
(Maths,abc)
(Science,ac)
(Science,bc)
(Chemistry,xc)
(Telugu,xyz)

将模式视为子:Maths、Maths、Science....等和名称:abc、def、ef..等

X = FOREACH data1 GENERATE CONCAT(sub,CONCAT('@',name));

X 的 O/P 是:

(Maths@abc)
(Maths@def)
(Maths@ef)
(Maths@abc)
(Science@ac)
(Science@bc)
(Chemistry@xc)
(Telugu@xyz)

关于hadoop - 字符串连接在 pig 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26299448/

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