gpt4 book ai didi

hadoop - 使用PIG加载Hive表的问题

转载 作者:行者123 更新时间:2023-12-02 21:06:07 25 4
gpt4 key购买 nike

我想使用PIG加入3个表,然后加载到Hive表中。在存储数据之前,我可以使用转储在屏幕上显示数据。我使用下面的命令来存储数据,它失败了。

store jnr_mas_ins INTO 'table_name' USING org.apache.hive.hcatalog.pig.HCatStorer();

错误是:
2017-01-25 10:58:48,487 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1002: Unable to store alias jnr_mas_ins
Details at logfile: /export/home/pig_1485359450881.log

我搜索了此站点,有人建议使用以下命令:
store jnr_mas_ins INTO 'hdfs://fullpath' USING org.apache.hive.hcatalog.pig.HCatStorer();


001 : Error setting output information. Cause : NoSuchObjectException(message:default.hdfs://fullpath table not found)
Details at logfile: /export/home/pig_1485359450881.log

请您帮助解决此问题,谢谢
以下是我用于填充表格的脚本。

account_master_ALL =使用org.apache.hive.hcatalog.pig.HCatLoader()加载“ACCT”;
account_master_fil =通过croft_source_sys_cd ==``ABC''过滤account_master_ALL;
account_master = foreach account_master_fil生成acct_master_key,(trans_date为null?'-999':trans_date)作为trans_date,(acct_data_1为null?'-999':acct_data_1)作为acct_data_1,(acct_data_2为null?'-999':acct_data_2) acct_data_2,(acct_data_3为null?'-999':acct_data_3)作为acct_data_3,(acct_data_4为null?'-999':acct_data_4)作为acct_data_4,(acct_data_5为null?'-999':acct_data_5,acct_data_5,acct_data_5,acct_data_5 ;
acct_detail_all =使用org.apache.hive.hcatalog.pig.HCatLoader();加载'acct_detail_tb'
acct_detail = foreach acct_detail_all生成c_number,b_number,a_number,c_coded,a_type,c_digit,s_number,r_type,r_cd,s_qty,s_b_cost,trade_qty,t_cost,p_date,load_date;
jnr_all =通过(a_number,b_number,c_coded,a_type,c_number,c_digit),按(acct_data_1,trans_date,acct_data_2,acct_data_3,acct_data_4,acct_data_5)加入acct_detail;
ins_master_all =使用org.apache.hive.hcatalog.pig.HCatLoader();加载'ins_acct';
jnr_mas_ins_all =通过(acct_detail::s_number)加入jnr_all,通过(acct_data_1)加入ins_master_all;
jnr_mas_ins = foreach jnr_mas_ins_all生成acct_master_key作为acct_master_key,ins_master_key作为ins_master_key,'ABC'作为code_dev,c_number作为c_number,b_number作为b_number,a_number作为src_a_number,c_code as as_type,作为类型c_number, ,r_cd作为r_cd,s_qty作为s_qty,s_b_cost作为s_b_cost,trade_qty作为trade_qty,t_cost作为t_cost,p_date作为p_date,CurrentTime()作为load_date,'PIG_USER'作为create_userid,CurrentTime()作为create_date,CurrentTime()作为f
使用org.apache.hive.hcatalog.pig.HCatStorer()存储jnr_mas_ins到'tartet_table'中

最佳答案

似乎您缺少jnr_mas_ins_all关系。这是哪里来的?因为没有jnr_mas_ins关系,所以jnr_mas_ins_all将为空。应该为ins_master_all吗?

ins_master_all = LOAD 'ins_acct' USING org.apache.hive.hcatalog.pig.HCatLoader();
jnr_mas_ins = foreach jnr_mas_ins_all generate acct_master_key as acct_master_key, ins_master_key as ins_master_key, 'ABC' as code_dev, c_number as c_number, b_number as b_number, a_number as src_a_number, c_coded as c_coded, a_type as a_type, c_digit as c_digit, s_number as s_number, r_type as r_type, r_cd as r_cd, s_qty as s_qty, s_b_cost as s_b_cost, trade_qty as trade_qty, t_cost as t_cost, p_date as p_date, CurrentTime() as load_date, 'PIG_USER' as create_userid, CurrentTime() as create_date, CurrentTime() as f_date;

关于hadoop - 使用PIG加载Hive表的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41856231/

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