【hive】hive 显示当前数据库名

配置前:
配置前
首先我们要明白,当hive CLI启动时,在hive > 提示符出现之前会优先执行文件.hiverc,Hive会自动在${HIVE_HOME}/bin目录下寻找名为.hiverc文件,由此可以在这个文件中设置配置一些常用的参数。
(由于它是隐藏文件,我们可以用Linux的ls -a命令查看。如果没有此文件,直接创建加入配置即可)

开始编辑文件:${HIVIE_HOME}/bin/.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,发现效果如下:
配置后

发布了2 篇原创文章 · 获赞 0 · 访问量 45

猜你喜欢

转载自blog.csdn.net/oYuZhongManBu1234/article/details/104213511
今日推荐