(7-6)hive的set命令


hive控制台set命令:

set hive.cli.print.current.db=true;

set hive.metastore.warehouse.dir=/hive




[root@i-love-you hive-0.14.0]# bin/hive

Logging initialized using configuration in jar:file:/usr/local/hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/co                                                                   .class]
SLF4J: Found binding in [jar:file:/usr/local/hive-0.14.0/lib/hive-j
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory
hive> set hive.cli.print.current.db=true;
hive (default)>








hive参数初始化配置set命令:
~/.hiverc



[root@i-love-you ~]# pwd
/root
[root@i-love-you ~]# ls -a
.                .bash_logout   .cshrc     .gnome2          .gtk-bo
..               .bash_profile  .dbus      .gnome2_private  .gvfs
.abrt            .bashrc        .esd_auth  .gnote           .hivehi
anaconda-ks.cfg  .cache         .gconf     .gnupg           .ICEaut
.bash_history    .config        .gconfd    .gstreamer-0.10  .imsett
[root@i-love-you ~]# vim .hiverc
[root@i-love-you ~]# more .hiverc
set hive.cli.print.current.db=true;
[root@i-love-you ~]#



自动加载hiverc,读取并执行里面内容:
[root@i-love-you hive-0.14.0]# bin/hive

Logging initialized using configuration in jar:file:/usr/local/hive-0.14.0/lib/hive-common-0.14.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hive-0.14.0/lib/hive-jdbc-0.14.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
hive (default)>





设置为false不好使,还是执行 .hiverc 里的内容:
[root@i-love-you hive-0.14.0]# bin/hive --hiveconf hive.cli.print.current.db=false;

Logging initialized using configuration in jar:file:/usr/local/hive-0.14.0/lib/hive-common-0.14.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hive-0.14.0/lib/hive-jdbc-0.14.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
hive (default)>






hive历史操作命令集:~/.hivehistory

[root@i-love-you ~]# ls -a
.                .bash_logout   .cshrc     .gnome2          .gtk-bookmarks  .imsettings.log     .nautilus      .viminfo       图片
..               .bash_profile  .dbus      .gnome2_private  .gvfs           install.log         .pulse         zookeeper.out  文档
.abrt            .bashrc        .esd_auth  .gnote           .hivehistory    install.log.syslog  .pulse-cookie  公共的         下载
anaconda-ks.cfg  .cache         .gconf     .gnupg           .hiverc         .local              .ssh           模板           音乐
.bash_history    .config        .gconfd    .gstreamer-0.10  .ICEauthority   .mozilla            .tcshrc        视频           桌面
[root@i-love-you ~]#







你可能感兴趣的:(7-6hive的set命令)