Details
Description
If you add a Sqoop action and include a variable in the sqoop command, and attempt to run the workflow, Oozie will choke on a spurious generated empty arg tag.
To reproduce:
- Create a new work flow
- Drag in a Sqoop action
- You'll see a default sqoop command. Replace any parameter with a variable. I used this:
import --connect jdbc:hsqldb:file:db.hsqldb --table ${tablename} --target-dir hdfs://localhost:8020/user/foo -m 1 - Save and submit the workflow
- Enter some value for the variable when prompted. I entered "test"
- An error message displays:
E0701: XML schema error, cvc-complex-type.2.4.a: Invalid content was found starting with element 'arg'. One of ' {"uri:oozie:sqoop-action:0.2":file, "uri:oozie:sqoop-action:0.2":archive}' is expected.
This is reproducible only with a new sqoop action. If you enter a sqoop action that does not contain a variable and then edit it to contain a variable, that works.
I examined the generated XML, and sure enough, there's an invalid (empty) arg tag generated:
<workflow-app name="Sqoop_Test_1" xmlns="uri:oozie:workflow:0.5">
<start to="sqoop-78ae"/>
<kill name="Kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<action name="sqoop-78ae">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<command>import --connect jdbc:hsqldb:file:db.hsqldb --table ${tablename} --target-dir hdfs://localhost:8020/user/foo -m 1</command>
<arg></arg>
</sqoop>
<ok to="End"/>
<error to="Kill"/>
</action>
<end name="End"/>
</workflow-app>