To get the available Hive client command line options use the -H option along with the hive command:
Run a metadata command from the command line and exit:
For this we will use the -e option followed by the meta command to be executed inside commas.
list the available databases.
Run a select statement from the command line and exit:
For this we will use the -e option followed by the select command to be executed inside commas.
Run a select statement from the command line in silent mode and exit:
For this we will use the -S option followed by the select command to be executed inside commas.
silent mode will suppers the header and footer of the result set output.
Pipe a sql command to hive client
Execute a sql command from a file in Hive client
For this we will use the -f option followed by the file location that contains the sql.