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//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]

hive.default.fileformat
SequenceFile
Default file format for CREATE TABLE statement. Options are TextFile and SequenceFile. Users can explicitly say CREAT
E TABLE ... STORED AS to override


默认创建的文件是SequenceFile,因为textfile在一些压缩算法下文件不可切分。

你可能感兴趣的:(hive)