Search code examples
shellhadoopoozieimpala

OOzie Shell -Impala action XML error


I am trying to run a sample impala query using ozzie. While running shell I am getting below error

Error: E0701 : E0701: XML schema error, cvc-complex-type.2.3: Element 'shell' cannot have character [children], because the type's content type is element-only.

Workflow.xml in HDFS

  <workflow-app name="shell-impala-select-wf" xmlns="uri:oozie:workflow:0.4">
    <start to="shell-impala-select"/>
        <action name="shell-impala-select">
            <shell xmlns="uri:oozie:shell-action:0.1">
                <job-tracker>${jobTracker}</job-tracker>
                <name-node>${nameNode}</name-node>
                <configuration>
                    <property>
                        <name>mapred.job.queue.name</name>
                        <value>${queueName}</value>
                    </property>
                </configuration>
                <exec>script.sh</exec>
                <file>${appPath}/script.sh#script.sh</file>
                <file>${appPath}/first_impala.iql#first_impala.iql</file>
           </shell>
           <ok to="end"/>
           <error to="kill"/>
        </action>
      <kill name="kill">
             <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
      </kill>
    <end name="end"/>
</workflow-app>

I checked..this is a valid XML.first_impala.iql has a select count(*) query.


Solution

  • The Oozie validate command says that's valid XML. I recently encountered the same error message for my own XML though. It was caused by some invalid whitespace characters that somehow got into my XML (a stray copy/paste most likely). Try removing all the leading/trailing whitespace from each line, and look for any other characters that may not be valid. Stack Overflow might have stripped the invalid characters from your post.