Skip to content

Commit

Permalink
fixing oozie
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaalgeorge committed May 10, 2019
1 parent 659a889 commit 5e84902
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ooziescripts/highAltitude.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name-node=hdfs://10.128.0.4:8020
jobTracker=10.128.0.4:8050
pigOutputPath=/tmp/openflight/oozieoutput/highAltitude/
pigScript=/openflight/features/high_altitude.pig
airportsLocation=/tmp/openflight/airports.dat
airlinesLocation=/tmp/openflight/airlines.dat
routesLocation=/tmp/openflight/routes.dat
planesLocation=/tmp/openflight/planes.dat
outputLocation=/tmp/openflight/output/mostConnectedAirports/
n=10
sqlScript=/openflight/SQLscripts/highAltitudesSQL.sh
TableName=highAltitudes
exportDir=/tmp/openflight/oozieoutput/highAltitude/part-r-00000
oozie.wf.application.path=${name-node}/tmp/deploy/ooziescripts/ooziescripts
oozie.use.system.libpath=true
oozie.libpath=/tmp/shared/jars
oozie.action.sharelib.for.sqoop=sqoop,hcatalog,hive
56 changes: 56 additions & 0 deletions ooziescripts/workflow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<workflow-app name="OpenAnalysisWorkflow" xmlns="uri:oozie:workflow:0.4">
<start to="PigAction"/>
<action name="PigAction">
<pig>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${name-node}</name-node>
<prepare>
<delete path="${pigOutputPath}">
</prepare>

<script>${pigScript}</script>
<param>airportsLocation=${airportsLocation}</param>
<param>airlinesLocation=${airlinesLocation}</param>
<param>routesLocation=${routesLocation}</param>
<param>planesLocation=${planesLocation}</param>
<param>outputLocation=${outputLocation}</param>
<param>n=${n}</param>
</pig>
<ok to="SQLAction">
<error to="PigKill">
</action>
<action name="SQLAction">
<shell>
<exec>${sqlScript}</exec>
<file>${sqlScript}</file>
</shell>
<ok to="SqoopAction">
<error to="SQLKill">
</action>
<action name="SqoopAction">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</jobTracker>
<name-node>${name-node}</name-node>
<command>sqoop export --connect jdbc:mysql://10.128.0.4:3306/OpenAnalysis --username hive --password admin -m 1 --table ${TableName} --export-dir ${exportDir} --input-fields-terminated-by ',' --input-null-string '\\N' --input-null-non-string '\\N'
</command>
</sqoop>
<ok to="end">
<error to="SqoopKill">
</action>
<kill name="PigKill">
<message>Pig Action Failed, error message
[${wf:errorMessage(wf:lastErrorNode())}]
</message>
</kill>
<kill name="SQLKill">
<message>SQL Action Failed, error message
[${wf:errorMessage(wf:lastErrorNode())}]
</message>
</kill>
<kill name="SqoopKill">
<message>Sqoop Action Failed, error message
[${wf:errorMessage(wf:lastErrorNode())}]
</message>
</kill>

</workflow-app>

0 comments on commit 5e84902

Please sign in to comment.