hive hiveconf 配置

hadoop fs -count -q


配置环境变量:
# hadoop env
export HADOOP_HOME=
export HADOOP_CONF_DIR=
# hive env
export HIVE_HOME=
export HIVE_CONF_DIR=
export HIVE_AUX_JARS_PATH=
在HIVE_CONF_DIR下面需要有hive-default.xml

HiveConf hive-default.xml hive-site.xml

HiveConf:

[b]hive.exec.mode.local.auto[/b] true 决定 Hive 是否应该自动地根据输入文件大小,在本地运行(在GateWay运行)
[b]hive.auto.convert.join[/b] false 是否根据输入小表的大小,自动将 Reduce 端的 Common Join 转化为 Map Join,从而加快大表关联小表的 Join 速度。

metastore相关配置:
hive.metastore.local true or false local or remote metastore
HiveMetaStoreClient里面:
HiveMetaStoreClient(HiveConf conf, HiveMetaHookLoader hookLoader){
boolean localMetaStore = conf.getBoolean("hive.metastore.local", false);
if (localMetaStore) { //true,本地metastore
// instantiate the metastore server handler directly instead of connecting
// through the network
client = new HiveMetaStore.HMSHandler("hive client", conf);
open = true;
return;
}
}


Hive Configuration Variables
[b]hive.exec.scratchdir [/b] This directory is used by hive to store the plans for different map/reduce stages for the query as well as to stored the intermediate outputs of these stages. /tmp/<user.name>/hive
[b]hive.exec.compress.output[/b] Determines whether the output of the final map/reduce job in a query is compressed or not. false
[b]hive.exec.compress.intermediate[/b] Determines whether the output of the intermediate map/reduce jobs in a query is compressed or not. false

[b]mapred.reduce.tasks[/b] :reduce数目
The default number of reduce tasks per job. Typically set to a prime close to the number of available hosts. Ignored when mapred.job.tracker is "local". Hadoop set this to 1 by default, whereas hive uses -1 as its default value. By setting this property to -1, Hive will automatically figure out what should be the number of reducers.


[b]hive.default.fileformat[/b]
<property>
<name>hive.default.fileformat</name>
<value>SequenceFile</value>
<description>Default file format for CREATE TABLE statement. Options are TextFile and SequenceFile. Users can explicitly say CREAT
E TABLE ... STORED AS <TEXTFILE|SEQUENCEFILE> to override</description>
</property>
默认创建的文件是SequenceFile,因为textfile在一些压缩算法下文件不可切分。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值