Support Questions
Find answers, ask questions, and share your expertise
Alert: Please see the Cloudera blog for information on the Cloudera Response to CVE-2021-4428

OOzie - Hive Script issue

	<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns="uri:oozie:workflow:0.5" name="Sub_WF_RESERVE_FEATURE_Insert_claiminfo">
<start to="Clean_output_folder" />
<!-- Delete Output Folder from HDFS -->
<action name="Clean_output_folder">
<hive xmlns="uri:oozie:hive-action:0.2">
<job-xml>hdfs://csaa-aap-sb/user/xgn74cha/reserve/hive-site.xml</job-xml> <configuration> <property> <name></name>
</property> <!--<property> <name>tez.lib.uris</name> <value>${tez_lib_path}</value> </property> -->
<property> <name></name> <value>${queueName}</value>
</property> </configuration>
<ok to="end" />
<error to="fail" />
<kill name="fail"> <message>Failed WorkFlow Name : SUB_WF_RESERVE_FEATURE_PREDICTIVE_MODEL_Insert_claiminfo </message> </kill>
<end name="end" /> </workflow-app>

I have below Oozie script. It completes when I run using oozie command, but script <script>hdfs://csaa-aap-sb/user/xgn74cha/reserve/script/InsertMaxRunDate.hql</script> does not return any result. While the same script returns result when I run Hue UI/ Beeline CLI. I have one observation that script does not return anything if I use Hive CLI. Kindly let me know, how to make the script to be run as beeline??

The script is

use reservemodel; SET hive.execution.engine = tez; set mapreduce.job.queuename=PA_clm;

SET hive.vectorized.execution.enabled=false; SET;

INSERT OVERWRITE DIRECTORY 'hdfs://csaa-aap-sb/user/xgn74cha/reserve/output1/'

select case when max(run_date) is null then to_date('1970-12-31') else to_date(max(run_date)) end as max_run_date from reservemodel.orc_policyinfo;


@Mamta Chawla

please look at my workflow

replace my pig script with your hive script and try it out. Replace my hive-site.xml with yours.


My issue is, it does not run on hive CLI, the script only runs on Beeline CLI. what changes to do in Oozie WF, so that HQL get executed on Beeline CLI??

I do not understand why the script doesn't run in hive but if you want beeline you need to use a hive2 action

Expert Contributor

hive action doesn't allow to return output to oozie workflow.

The only way to capture output is to use Java or Shell actions:

Read about capture-output flag.