【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
hive-shell:
配置命令:
#在命令行中显示当前数据库名
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;
#可以显示当前数据库名。
set hive.cli.print.current.db=true;
执行命令:
hive-shell命令支持dfs命令不支持fs命令。
hive-shell 按Tab键可以自动补全命令。
use datebase名:设置默认的数据库。