To get the available Hive client command line options use the -H option along with the hive command:
[root@sandbox tmp]# hive -H
WARNING: Use "yarn jar" to launch YARN applications.
usage: hive
-d,--define <key=value Variable subsitution to apply to hive
commands. e.g. -d A=B or --define A=B
--database <databasename Specify the database to use
-e <quoted-query-string SQL from command line
-f <filename SQL from files
-H,--help Print help information
--hiveconf <property=value Use value for given property
--hivevar <key=value Variable subsitution to apply to hive
commands. e.g. --hivevar A=B
-i <filename Initialization SQL file
-S,--silent Silent mode in interactive shell
-v,--verbose Verbose mode (echo executed SQL to the
console)
[root@sandbox tmp]# hive -e "show databases;"
WARNING: Use "yarn jar" to launch YARN applications.
Logging initialized using configuration in file:/etc/hive/2.4.0.0-169/0/hive-log4j.properties
OK
default
testdb
xademo
Time taken: 2.756 seconds, Fetched: 3 row(s)
[root@sandbox tmp]# hive -e "select * from testdb.tblone;"
WARNING: Use "yarn jar" to launch YARN applications.
Logging initialized using configuration in file:/etc/hive/2.4.0.0-169/0/hive-log4j.properties
OK
1
Time taken: 11.128 seconds, Fetched: 1 row(s)
[root@sandbox tmp]#
[root@sandbox tmp]# hive -S -e "select * from testdb.tblone;"
WARNING: Use "yarn jar" to launch YARN applications.
1
[root@sandbox tmp]# echo "select * from testdb.tblone;" | hive
WARNING: Use "yarn jar" to launch YARN applications.
Logging initialized using configuration in file:/etc/hive/2.4.0.0-169/0/hive-log4j.properties
hive select * from testdb.tblone;
OK
1
Time taken: 8.108 seconds, Fetched: 1 row(s)
[root@sandbox tmp]# cat scr.sql
select * from testdb.tblone;
[root@sandbox tmp]# hive -f scr.sql
WARNING: Use "yarn jar" to launch YARN applications.
Logging initialized using configuration in file:/etc/hive/2.4.0.0-169/0/hive-log4j.properties
OK
1
Time taken: 8.97 seconds, Fetched: 1 row(s)