Hive:参数配置方式

参数配置方式

1.set 命令使用:查看当前所有的配置信息
hive>set;

2.配置参数的三种方式:
在这里插入图片描述

3.三种配置方式的优先级
上述三种设定方式的优先级依次递增。即 配置文件 < 命令行参数 < 参数声明。
注意:某些系统级的参数,例如log4j相关的设定,必须用前两种方式设定,因为那些参数的读取在会话建立以前已经完成了。

4.测试三种配置方式优先级
1)在2.8.1中配置文件中设置了hive.cli.print.header和 hive.cli.print.current.db这两个参数。
[atguigu@hadoop102 hive]$ bin/hive
hive (default)> select * from test2;
OK
test2.id
1002
Time taken: 1.565 seconds, Fetched: 1 row(s)

2)通过set命令,设置hive.cli.print.current.db 参数位false
hive(default)> set hive.cli.print.current.db = false;
hive>

3)退出,重启hive,命令如下
[atguigu@hadoop102 hive]$ bin/hive –hiveconf hive.cli.print.current.db = false
hive>

猜你喜欢

转载自blog.csdn.net/weixin_45427648/article/details/131839281