Last active
January 4, 2021 11:52
-
-
Save tmusabbir/7019600 to your computer and use it in GitHub Desktop.
Oozie Example: Hive Actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oozie Example: Hive Actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hive> describe temp; | |
OK | |
id bigint None | |
name string None | |
Time taken: 0.261 seconds, Fetched: 2 row(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load data inpath '${INPUT_PATH}' overwrite into table temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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