Oozie执行hive,传入参数
1. 新建一个workflow
2. 拖入一个hive2
3. hive脚本如下
CREATE TABLE IF NOT EXISTS spider_tmp.org_invest_fund_${date} (`id` int, `info_id` int, `company` string, `company_url` string, `legal_person` string, `reg_capital` string, `establish_date` string, `investor` string, `update_time` string)ROW FORMAT DELIMITEDFIELDS TERMINATED BY '`'STORED AS TEXTFILE;
注意,此处${date}表示需要执行时传入的参数
4. 添加参数5. 启动,填入参数即可
6.workflow.xml如下
Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}] ${jobTracker} ${nameNode} jdbc:hive2://hadoop1:10000/spider_tmp date=${date}