Hive命令行参数
来源:互联网 发布:sql导出数据库成excel 编辑:程序博客网 时间:2024/04/30 08:36
$HIVE_HOME/bin/hive是一个shell工具,它可以用来运行于交互或批处理方式配置单元查询。
语法:
Usage: hive [-hiveconf x=y]* [<-i filename>]* [<-f filename>|<-e query-string>] [-S]
-i <filename>: Initialization Sql from file (executed automatically and silently before any other commands)
-e 'quoted query string': 运行引号内sql查询语句 Sql from command line
-f <filename>: 从文件中运行sql语句 Sql from file
-S: Silent mode in interactive shell where only data is emitted
-hiveconf x=y: Use this to set hive/hadoop configuration variables.
-e 与 -f 不能同时使用。In the absence of these options, interactive shell is started. 但是,-i 能够与任意参数同时使用。多个 –i 的实例可以用来执行多个初始化脚本scripts。However, -i can be used with any other options. Multiple instances of -i can be used to execute multiple init scripts.
通过命令:hive –h 可以查看应用的帮助文档.To see this usage help, run hive -h
运行一个查询:
$HIVE_HOME/bin/ hive -e 'select count(*) from c02_clickstat_fatdt1'
Example of setting hive configuration variables
$HIVE_HOME/bin/hive -e 'select a.col from tab1 a' -hiveconfhive.exec.scratchdir=/home/my/hive_scratch -hiveconf mapred.reduce.tasks=32
将查询结果导出到一个文件
HIVE_HOME/bin/hive -S -e ' select count(*) from c02_clickstat_fatdt1' > a.txt
运行一个脚本
HIVE_HOME/bin/hive -f /home/my/hive-script.sql
Example of running an initialization script before entering interactive mode
HIVE_HOME/bin/hive -i /home/my/hive-init.sql
- Hive命令行参数
- Hive命令行参数
- HIVE 命令行
- hive命令行
- Hive命令行
- HIVE 命令行
- HIVE 命令行
- HIVE 命令行
- 【Hive】Hive参数
- hive参数
- Hive参数
- hive参数
- Hive 参数
- Hive 参数
- Hive 参数
- Hive参数
- hive参数
- hive cli命令行选项
- zedGraph参数设置
- VideoView播放视频
- android之自定义ViewGroup和自动换行的布局的实现
- SAP EWM 仓库任务创建和确认的相关函数
- 使用HBase处理海量数据系列—Part4—Java API
- Hive命令行参数
- web服务器和应用程序服务器的区别
- JSP内置对象---request
- Facebook虚假点赞说明营销越来越重视用户社会化行为
- 意在研发与渠道互补
- Quartus:instantiates undefined entity错误
- Native Method特点
- Xcode两个工程切换的方法
- ios --- Tabbar 的图标模糊问题