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.

Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?

Solved Go to solution
Highlighted

Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?

Expert Contributor

Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?

Expert Contributor

unfortunately , I don't any way for configuring sqoop incr jobs from oozie. So, had to write a shell script for the same.

#!/bin/bash if [ $# -ne 1 ]; then

echo "Not enough arguments to start the job,Synatx is Incr_jobs.sh arg1"

else sqoop job --exec $1 > sqooplog.txt 2>&1

fi

grep -i "Merge MapReduce job failed" sqooplog.txt if [ `echo $?` -eq 0 ] then

echo "`echo $1` job failed" | mailx -s "`echo $1` job failed" -a sqooplog.txt <mailid>

else echo "`echo $1` job completed successfully" | mailx -s "`echo $1` job completed successfully" <mailid>

fi

2 REPLIES 2

Re: Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?

Expert Contributor

My workflow.xml looks this way ...

<action name="sqoop-incr"> <sqoop xmlns="uri:oozie:sqoop-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> <command>sqoop job --exec IncLocations</command> </sqoop> <ok to="end"/>

Error

Workflow Failed. Failing node [sqoop-incr] 2017-01-23 23:10:14,977 WARN ParameterVerifier:523 - SERVER[] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[-] ACTION[-] The application does not define formal parameters in its XML definition

Re: Can we schedule a sqoop incremental job ( sqoop job --exec IncJob) using oozie ?

Expert Contributor

unfortunately , I don't any way for configuring sqoop incr jobs from oozie. So, had to write a shell script for the same.

#!/bin/bash if [ $# -ne 1 ]; then

echo "Not enough arguments to start the job,Synatx is Incr_jobs.sh arg1"

else sqoop job --exec $1 > sqooplog.txt 2>&1

fi

grep -i "Merge MapReduce job failed" sqooplog.txt if [ `echo $?` -eq 0 ] then

echo "`echo $1` job failed" | mailx -s "`echo $1` job failed" -a sqooplog.txt <mailid>

else echo "`echo $1` job completed successfully" | mailx -s "`echo $1` job completed successfully" <mailid>

fi

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