Search code examples
hivehiveqloozieoozie-workflow

Oozie Hive Action keeps failing due to parameter assignment?


I'm trying to test out running a simple Hive script using Oozie, but I keep getting an error that I cannot make sense of.

Every time I submit a job, I get an error message that says "Job failed, error message[Parameter expression must contain an assignment: jobRequest]". However, I have this parameter defined and assign it a value when I originally submit the config.

The parameter in question is for an external hive table name that I'm trying to create. In the Oozie workflow, I define the table name parameter that is getting passed to the Hive script here:

<param>${hiveTableName}</param>

I then create a job.xml that I submit to oozie, where this parameter is assigned the value like so:

<property>
    <name>hiveTableName</name>
    <value>jobRequest</value>
</property>

Has anyone else ran into an issue like this or have any idea of what might be causing it? It seems like the parameter is properly defined and assigned, but the job keeps failing with the above error message. If it helps, the xml namespace that I'm using is:

<hive xmlns="uri:oozie:hive-action:0.2">

Solution

  • I get an error message that says "Job failed, error message[Parameter expression must contain an assignment: jobRequest]"

    Its complaining that the assignment operator is missing in the param tag. Check the documentation for more details https://oozie.apache.org/docs/3.3.1/DG_HiveActionExtension.html

    First solution, using property tag Use like below

    <property>
        <name>hiveTableName</name>
        <value>jobRequest</value>
    </property>
    

    Add param like this :

     <param>hiveTableName=${hiveTableName}</param>
    

    Second solution via job.properties : you want to pass the parameter with <param> tag, define the variable in your job.properties and then pass with the <param> tag.

    e.g In job.properties add,

    hiveTableName=jobRequest
    

    then put <param>hiveTableName=${hiveTableName}</param> in the oozie workflow hive action