hivevar ignoring values after the space hivevar ignoring values after the space shell shell

hivevar ignoring values after the space


Double-quote variables in shell:

--hivevar filename="$FILE_NAME"

In this case string containing spaces will be passed as a single variable.

Alternatively you can pass it like this: --hivevar filename=${FILE_NAME}

Also your echo command should be echo "$FILE_NAME" not echo FILE_NAME

Variable passing demo:

var="one two three";echo "$var"

Prints:

one two three

Pass it to hive:

hive -hivevar var="$var"

Print in the hive:

hive> select '${hivevar:var}';OKone two three