When you use a string parameter in a SQL override, a join expression, or a filter query for a Hive source, you need to add quotes around the parameter reference if the parameter represents a literal value. You can use single or double quotes. This requirement is for Hive sources in mappings that run in the native execution environment or in the Hadoop execution environment.
For example, you need to create a filter that selects Hive source rows with a specific department name. You create a string parameter that represents the department name. You assign a default value of R&D for the department name parameter.
The following image shows the string parameter:
When you use the parameter in a filter query for a Hive source, you must include quotes around the parameter name. Otherwise the mapping fails at run time with a SQL parser error.
The following image shows the filter query for the Hive source on the
Query
view of the
Properties
tab:
By default, the Expression editor does not add the quotes around the parameter. You must manually add them.
You do not need to add single or double quotes around the parameter name if the parameter contains a column name or a sub query name.
The following image show a string parameter with a default value that is a column name:
The following image shows a filter query that uses the parameter: