How to Return Hive Query Results Similary to MySQL \G in One Vertical Column

When trying to look at data in a database with really wide rows even just selecting 1 row to see the data is nearly impossible to understand when the single row wraps 7 or 8 times.

MySQL offers the ‘\G’ option to display the output in a single column.

The corresponding method in Hive is to execute the following set command:

!set outputformat vertical
SELECT something FROM some table;
Continue reading “How to Return Hive Query Results Similary to MySQL \G in One Vertical Column”

Running Dynamically Generated Hive Queries From a Shell Script

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”