How to passing variable containing spaces to hive? How to passing variable containing spaces to hive? hadoop hadoop

How to passing variable containing spaces to hive?


This have a very good explanation

https://unix.stackexchange.com/questions/131766/why-does-my-shell-script-choke-on-whitespace-or-other-special-characters

Essentially you need to put double quotes between your variable like this to preserve multiple values

QUERY="select * from abc;"hive -f hive_script.hql -hivevar QUERY="${QUERY}"