If you want to write a HQL hive query and run it mulitple times from a shell script, each time passing it different data for the query, here is a quick example that should get you started.
The first thing to know is that by specifying n number of -hivevar key value pairs when invoking hive on the command line will allow you to pass that data into the hive process.
For example, if you do the following
$ hive
→ Continue reading “Running Dynamically Generated Hive Queries From a Shell Script”