首页 > 其他 > 详细

Hive 教程(六)-命令补充说明

时间:2019-11-02 17:26:27      阅读:92      评论:0      收藏:0      [点我收藏+]

hive 命令参数

启动 hive 的方式

[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:不进入 shell,在 linux 命令行执行 sql

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

注意指定 数据库和数据表

-f:在文件中执行 sql

把 sql 语句写入文件,随便什么文件格式

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

 

hive cli 操作 hdfs

hive> dfs - ls /;

 

hive cli 操作本地文件

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

 

hiveServer2

未完待续...

Hive 教程(六)-命令补充说明

原文:https://www.cnblogs.com/yanshw/p/11780752.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!