Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to pass partition datetime variable to hive scrip when using Oozie Workflow?

Highlighted

How to pass partition datetime variable to hive scrip when using Oozie Workflow?

hi All,

I am using Oozie:Hive workflow. How can I pass the partition datetime variable in hive script? I have my Oozie workflow and hive script below:

workflow:

<action name="hive-node"> <hive xmlns="uri:oozie:hive-action:0.2"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <configuration> <property> <name>mapred.job.queue.name</name> <value>${queueName}</value> </property> </configuration> <script>script.q</script> </hive> <ok to="end"/> <error to="fail"/> </action>

script.q

LOAD DATA INPATH '/dir/myload/' OVERWRITE INTO TABLE test_db.test_tmp; INSERT INTO TABLE test_db.test_tmp Partition (datehour=howtopassdatetimehere) SELECT * FROM test_db.test_tmp;

Please help I am new to Oozie

Thanks

JN

Don't have an account?
Coming from Hortonworks? Activate your account here