hive 使用方法--小工具(二)
来源:互联网 发布:韩宜淘宝旗舰店 编辑:程序博客网 时间:2024/05/18 23:12
1、小工具:
- desc student; 描述表
- desc extended student ; 查看表的详细信息(表的类型(内部表、外部表),表压缩否)
- desc formatted student ; 格式化输出表信息
- show create table student ;查看建表语句
- show functions ; 查看hive中的函数
- desc function upper; 描述函数
- desc function extended upper; 描述方法具体使用方法
- show tables; 查看所有的表
- show databases; 查看所有的数据库
- set hive.cli.print.header =true 设置参数,临时生效
- minimal 是否跑mapreduce可配
2、帮助信息 (在shell中的help)
bin/hive -help 一个横杠
[root@yeemi01 hive-0.13.1-cdh5.3.6]# bin/hive -helpusage: hive -d,--define <key=value> Variable subsitution to apply to hive commands. e.g. -d A=B or --define A=B --database <databasename> Specify the database to use -e <quoted-query-string> SQL from command line -f <filename> SQL from files -H,--help Print help information -h <hostname> connecting to Hive Server on remote host --hiveconf <property=value> Use value for given property --hivevar <key=value> Variable subsitution to apply to hive commands. e.g. --hivevar A=B -i <filename> Initialization SQL file -p <port> connecting to Hive Server on port number -S,--silent Silent mode in interactive shell -v,--verbose Verbose mode (echo executed SQL to the console)* bin/hive -e "select * from student" >> test.log //加双引号,多条Hql用分号分割,可不用开启hive,在脚本执行;* bin/hive -f hive.sql ; //执行文件,在文件中写入多个Hql。* bin/hive --hiveconf //添加参数,key-value对形式,对当前创库有效(相当于在配置文件中设置配置项); --》一般用于测试,不会影响集群中其他的进程* bin/hive -d default 指定默认进入default数据库*
bin/hive - -help (两个横杠,中间没空格)
[root@yeemi01 hive-0.13.1-cdh5.3.6]# bin/hive --helpUsage ./hive <parameters> --service serviceName <service parameters> Service List: beeline cli help hiveserver2 hiveserver hwi jar lineage metastore metatool orcfiledump rcfilecat schemaTool version Parameters parsed: --auxpath : Auxillary jars --config : Hive configuration directory --service : Starts specific service/component. cli is defaultParameters used: HADOOP_HOME or HADOOP_PREFIX : Hadoop install directory HIVE_OPT : Hive optionsFor help on a particular service: ./hive --service serviceName --helpDebug help: ./hive --debug --help
3、临时添加配置项:
命令行启动hive时,用--hiveconf hive.cli.print.header = true 进入hive,执行 set hive.cli.print.header = true;
4、 访问本地/hdfs
- 访问本地 : ! ls / –>用叹号
- 访问hdfs : dfs -ls / –>不需要再去找namenode入口,直接去对hdfs进行操作,比用hdfs的dfs 命令快,性能消耗主要在启动进程上。
阅读全文
0 0
- hive 使用方法--小工具(二)
- 信息安全专栏(二)AES加密小工具
- 网页收藏小工具(二)--python异常处理
- 照片处理小工具三合一设计到实现(二)
- Android常用小工具的使用方法
- SQLServer编写存储过程小工具(二)
- 高效能小工具(福利)
- 小工具
- 小工具
- 小工具
- 小工具
- 小工具
- 小工具
- 小工具
- 小工具
- 小工具
- 小工具
- 小工具
- poj2486——apple tree
- Scratch
- 关于Smalltalk,squeak,scratch的学习体验(转)
- ADS1248
- 使用JPype实现Python调用JAVA程序
- hive 使用方法--小工具(二)
- python验证软件签名
- sublime基础配置(html环境)
- MMF2 光源制作教程(转)
- 设计模式(6)——适配器 Adapter
- 以太坊本地私有链开发环境搭建(转)
- linux下限制CPU使用率的3种方法 (转)
- Linux文本内容替换
- ESP8266 GPIO入门(转)