hiverc简介

 

 

 

文件是隐藏文件,我们可以用Linux的ls -a命令查看,我们在启动Hive的时候会去加载这个文件中的内容,因此可以再次文件中添加全局参数,

比如你自定义的函数,

一般这文件在 ~/下,如果没有,可以通过vi来自行创建次 .hiverc文件,

 

比如我这里设置的内容为:

 

#在命令行中显示当前数据库名
set hive.cli.print.current.db=true; 
#查询出来的结果显示列的名称
set hive.cli.print.header=true;
#启用桶表
set hive.enforce.bucketing=true;
#压缩hive的中间结果
set hive.exec.compress.intermediate=true;
#对map端输出的内容使用BZip2编码/解码器
set mapred.map.output.compression.codec=org.apache.hadoop.io.compress.BZip2Codec;
#压缩hive的输出
set hive.exec.compress.output=true;
#对hive中的MR输出内容使用BZip2编码/解码器
set mapred.output.compression.codec=org.apache.hadoop.io.compress.BZip2Codec;
#让hive尽量尝试local模式查询而不是mapred方式
set hive.exec.mode.local.auto=true;
#增加Hive自定义函数设置 
add jar /home/new_load_data/lib/hive-udf.jar; 
create temporary function hivenvl as 'org.apache.hadoop.hive.ql.udf.hivenvl';

 

你可能感兴趣的:(hiverc简介)