hive怎么显示当前数据库名
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,hive怎么显示当前数据库名,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。当hive CLI启动时,在hive > 提示
千家信息网最后更新 2026年11月01日hive怎么显示当前数据库名
hive怎么显示当前数据库名,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。
当hive CLI启动时,在hive > 提示符出现之前会优先执行文件.hiverc,Hive会自动在${HIVE_HOME}/bin目录下寻找名为.hiverc文件,由此可以在这个文件中设置配置一些常用的参数。由于它是隐藏文件,我们可以用Linux的ls -a命令查看。
编写 .hiverc,参考链接, 有说放在 $HOME/.hiverc 或者 $HIVE_HOME/bin/.hiverc
Putting the global hiverc in $HIVE_HOME/bin/.hiverc is deprecated. Please use $HIVE_CONF_DIR/.hiverc instead
#在命令行中显示当前数据库名 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;
Wednesday, August 28, 2013Apache Hive: The .hiverc fileWhat is .hiverc file?It is a file that is executed when you launch the hive shell - making it an ideal place for adding any hive configuration/customization you want set, on start of the hive shell. This could be:- Setting column headers to be visible in query results- Making the current database name part of the hive prompt- Adding any jars or files- Registering UDFs.hiverc file locationThe file is loaded from the hive conf directory.I have the CDH4.2 distribution and the location is: /etc/hive/conf.cloudera.hive1If the file does not exist, you can create it.It needs to be deployed to every node from where you might launch the Hive shell.[Note: I had to create the file; The distribution did not come with it.]Sample .hivercadd jar /home/airawat/hadoop-lib/hive-contrib-0.10.0-cdh5.2.0.jar;set hive.exec.mode.local.auto=true;set hive.cli.print.header=true;set hive.cli.print.current.db=true;set hive.auto.convert.join=true;set hive.mapjoin.smalltable.filesize=30000000;
查询后信息显示配置
1)在 hive-site.xml文件中添加如下配置信息,就可以实现显示当前数据库,以及查询表的头信息配置。
hive.cli.print.header true hive.cli.print.current.db true
2)重新启动hive,对比配置前后差异。
配置前:
配置后:
看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注行业资讯频道,感谢您对的支持。
配置
文件
查询
数据
数据库
信息
内容
输出
命令
结果
编码
解码器
帮助
清楚
参数
名称
对此
差异
常用
提示符
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网加科技
广州淘业互联网络科技
互联网和科技创新
互联网科技财经
金融科技与互联网金融
盛创互联网科技有限公司
滨湖区互联网智能科技产品供应
深圳市运趣互联网科技有限公司
银川新华互联网科技职业技术培训学校图片
速维有品互联网信息科技(苏州)有限公司
呼和浩特新华互联网科技学院
米聚互联网科技南京有限公司排面
无锡工业互联网科技有限公司
怎样加入科技互联网
皮皮虾互联网科技有限公司
萌小萌互联网科技河南有限公司
张家口科技产业互联网平台
米泉互联网科技专业怎么样
互联网科技和医药行业
众联互联网络科技
什么是科技互联网
亿人帮互联网科技有限公司
互联网科技资迅
浩特互联网科技
互联网科技生活的内容
互联网对科技的发展
中国航天科技大学国际工业互联网
富国互联网金融科技混合基金
北京天晋互联网科技有限公司
互联网企业和网络科技有限公司