hive中配置属性
用户可通过4种方式配置hive运行时的参数,分别是:(1)配置文件;(2)命令行参数;(3).hiverc文件;(4)命令端set命令;这4种方式的优先级依次递增。
-
通过配置文件修改
默认设置都在${HIVE_HOME}/conf/hive-default.xml文件中,如果需要修改默认设置可以在conf目录下新建一个hive-site.xml文件,并在其中做配置,对所有的任务有效。配置格式如下:
<configuration>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
<property>
Another property configuration
</property>
</configuration>
用户的自定义配置会覆盖系统默认配置,同时由于hive会读取hadoop的配置,而hive作为hadoop的上层应用,也会覆盖hadoop的配置
- 在启动hive cli的时候进行配置,例如: hive --hiveconf mapreduce.job.queuename=queue1,则本次任务的所有作业都会提交到队列queue1中,关闭cli后,该配置失效。
- 进入cli后用set关键字配置,set后不带参数则查看当前的所有配置
-
在$HOME/.hiverc中配置
同3,只是将set语句写在这里,会在启动命令端的时候执行
浙公网安备 33010602011771号