hadoop - Check whether a variable exists or not in EL Expression inside Oozie Hive action -


i trying create common template oozie workflow used running different hive scripts. each hive script has own parameters.

on hive action in oozie, while setting parameters using param tag, need check if variable exists or not , if not exist, need default " ".

i tried,
< param>my_parameter_var=${empty my_parameter?" ":my_parameter}< / param >

this works check if my_parameter null or empty string. check fails if variable doesn't exist @ all; below error:

error code : el_error
error message : variable [my_parameter] cannot resolved

can please assist me on how achieve this?

i not sure if still needed in case, there way combination of firstnotnull , wf:conf el functions below. remove white spaces in param element start , end.

< param>my_parameter_var=${firstnotnull(wf:conf('my_parameter'),' ')}< /param >

wf:conf shall return my_parameter's value if not empty/null/undefined or return empty string. ref: https://oozie.apache.org/docs/3.2.0-incubating/workflowfunctionalspec.html#a4.2.3_workflow_el_functions

firstnotnull shall return first argument value if not empty/null or return second argument value. ref: https://oozie.apache.org/docs/3.2.0-incubating/workflowfunctionalspec.html#a4.2.1_basic_el_constants

thanks.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -