Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Oozie Example: Hive Actions
Oozie Example: Hive Actions
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.HiveMain], main() threw exception, org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassNotFoundException: org.apache.hcatalog.security.HdfsAuthorizationProvider
java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassNotFoundException: org.apache.hcatalog.security.HdfsAuthorizationProvider
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:280)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:670)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
at org.apache.oozie.action.hadoop.HiveMain.runHive(HiveMain.java:261)
[ambari-qa@ip-10-0-0-51 hive-oozie]$ hadoop fs -lsr /user/ambari-qa/example/hive-oozie
-rwx------ 3 ambari-qa hdfs 3383 2013-03-01 21:28 /user/ambari-qa/example/hive-oozie/hive-site.xml
-rwx------ 3 ambari-qa hdfs 24 2013-03-01 21:29 /user/ambari-qa/example/hive-oozie/script.hql
-rwx------ 3 ambari-qa hdfs 1852 2013-03-01 21:29 /user/ambari-qa/example/hive-oozie/workflow.xml
hive> describe temp;
OK
id bigint None
name string None
Time taken: 0.261 seconds, Fetched: 2 row(s)
[ambari-qa@ip-10-0-0-51 hive-oozie]$ hadoop fs -lsr /user/ambari-qa/example/hive-input/temp
-rwx------ 3 ambari-qa hdfs 3383 2013-03-01 22:18 /user/ambari-qa/example/hive-input/temp/r-000000
-rwx------ 3 ambari-qa hdfs 24 2013-03-01 22:19 /user/ambari-qa/example/hive-input/temp/r-000001
-rwx------ 3 ambari-qa hdfs 1852 2013-03-01 22:19 /user/ambari-qa/example/hive-input/temp/r-000002
[root@ip-10-0-0-51 ~]# su -l oozie -c "hadoop fs -put /usr/lib/hcatalog/share/hcatalog/hcatalog-core-0.11.0.1.3.2.0-111.jar /user/oozie/share/lib/hive"
[root@ip-10-0-0-51 ~]# su -l oozie -c "hadoop fs -put /usr/lib/hcatalog/share/hcatalog/hcatalog-server-extensions-0.11.0.1.3.2.0-111.jar /user/oozie/share/lib/hive"
[root@ip-10-0-0-51 ~]# su -l oozie -c "hadoop fs -chmod 775 /user/oozie/share/lib/hive/hcatalog-core-0.11.0.1.3.2.0-111.jar"
[root@ip-10-0-0-51 ~]# su -l oozie -c "hadoop fs -chmod 775 /user/oozie/share/lib/hive/hcatalog-server-extensions-0.11.0.1.3.2.0-111.jar"
nameNode=hdfs://ip-10-0-0-52:8020
jobTracker=ip-10-0-0-53:50300
queueName=default
exampleRoot=example
oozie.use.system.libpath=true
oozie.libpath=/user/oozie/share/lib
oozie.wf.application.path=${nameNode}/user/${user.name}/${exampleRoot}/hive-oozie
inputPath=${nameNode}/user/${user.name}/${exampleRoot}/hive-input/temp/*
load data inpath '${INPUT_PATH}' overwrite into table temp;
<workflow-app xmlns="uri:oozie:workflow:0.4" name="hive-wf">
<start to="hive-node"/>
<action name="hive-node">
<hive xmlns="uri:oozie:hive-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>hive-site.xml</job-xml>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<script>script.hql</script>
<param>INPUT_PATH=${inputPath}</param>
</hive>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Hive failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.