Hive tutorial (VI) - Command Supplement

hive command parameters

Start hive of way

[root@hadoop10 hive2.3.6]# hive --heip
 -d,--define <key=value>          Variable substitution 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 substitution 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)

-e : do not enter the shell, in linux command line execution sql

[root@hadoop10 hive2.3.6]# hive -e 'select * from hive1.hive_01 limit 10';

Note that the specified database and data tables

-f : execute sql in a file

The sql statement written to the file, whatever file format

[root@hadoop10 hive2.3.6]# hive -f sql.sh

 

hive cli operation hdfs

hive> dfs - ls /;

 

hive cli operation of the local file

hive> ! ls /usr/lib/hive2.3.6;
bin
binary-package-licenses
conf
examples

 

hiveServer2

To be continued ...

Guess you like

Origin www.cnblogs.com/yanshw/p/11780752.html