[hadoop@hadoop hive-0.13.1]$ bin/hive -help

usage: 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)

1.使用非交互式执行hive语句

  bin/hive -e <quoted-query-string>

eg:

  bin/hive -e "select * from default.student ;"

2.运行存放hive语句的文件

  bin/hive -f <filename>

eg:

  $ echo "select * from db_hive.student ;"  >  hivef.sql

  $ bin/hive -f /opt/datas/hivef.sql

  $ bin/hive -f /opt/datas/hivef.sql > /opt/datas/hivef-res.txt

3.与用户udf相互使用

  bin/hive -i <filename>

4.在hive cli命令窗口中如何查看hdfs文件系统  

  hive (default)> dfs -ls / ; 

5.在hive cli命令窗口中如何查看本地文件系统

  hive (default)> !ls /opt/datas ;

Hive常用非交互式命令的更多相关文章

  1. 两种Linux下非交互式命令的实现

    一.概述 在Linux环境,有多种实现自己主动化的脚本语言.如Shell.Python.Perl.Tcl等. Shell语言因与Shell外壳结合紧密,是最常见的实现自己主动化的脚本语言. 同一时候, ...

  2. hadoop中hive常用的交互式操作

    hive的帮助命令: [hadoop@master tmp]$ hive -help usage: hive -d,--define <key=value> Variable substi ...

  3. Hive:常用的一些命令

    1.一般可以通过beeline,代理方式登录hive; 2.使用数据库abc_hive_db:use abc_hive_db; 3.查看数据库中有哪些表:show tables :有哪些特定表 sho ...

  4. Hive常用的SQL命令操作

    Hive提供了很多的函数,可以在命令行下show functions罗列所有的函数,你会发现这些函数名与mysql的很相近,绝大多数相同的,可通过describe function functionN ...

  5. 安卓日常开发和逆向中常用的shell命令与非shell命令

    简述shell 命令与 非shell命令区别 shell命令不用先adb shell进入界面执行 非shell命令必须要 adb shell进入界面执行 基础非shell命令 1.安装app adb ...

  6. mysql常用命令、非交互式mysql命令看29条

    CentOS下mysql数据库常用命令总结1.更改root密码 mysqladmin -uroot password 'yourpassword' 2.远程登陆mysql服务器 mysql -uroo ...

  7. Hive 常用命令和语句

    示例数据库为 db_hive 1. 创建表 create-table.sql create table if not exists db_hive.tb_user ( id int, username ...

  8. 1.10-1.11 hive交互式命令讲解

    一.hive 交互式命令参数 #帮助 [root@hadoop-senior hive-0.13.1]# bin/hive -h Missing argument for option: h usag ...

  9. HIve常用CLI命令

    1. 清楚屏幕:Ctrl+L 或者!Clear 最后加上分号 2. 查看数据仓库中的表:show tables; 3. 查看数据仓库中内置函数:show functions: 4. 查看表结构 :de ...

随机推荐

  1. sh_06_break

    sh_06_break i = 0 while i < 10: # break 某一条件满足时,退出循环,不再执行后续重复的代码 # i == 3 if i == 3: break print( ...

  2. 苹果cms v10官网下载

    苹果CMS程序是一套采用PHP+MYSQL环境下运行的完善而强大的快速建站系统.经过近多年的开发经验和技术积累,苹果CMS程序已逐步走向成熟,在易用性和功能上已经成为同行中的佼佼者.程序体积小-> ...

  3. LBS 基于位置的服务

    LBS (Location Based Services)基于位置的服务 基于位置的服务,它是通过电信移动运营商的无线电通讯网络(如GSM网.CDMA网)或外部定位方式(如GPS)获取移动终端用户的位 ...

  4. hibernate中的@GeneratedValue与@GenericGenerator

    1.GeneratedValue与GenericGenerator的区别 @GeneratorValue注解----JPA通用策略生成器 @GenericGenerator注解----自定义主键生成策 ...

  5. jdbcType="DATE"和jdbcType=" TIMESTAMP"的区别

    原文: https://www.cnblogs.com/fswhq/p/jdbcType.html 当传入null值时,jdbcType 会防止null空指针异常报错 Mybatis 中jdbcTyp ...

  6. C# DataTable 增加行与列

    亲测有用的方法 DataTable AllInfos = new DataTable();//生成一个表格 DataColumn typeColumn = new DataColumn();//建一个 ...

  7. 快速找到oracle的alert日志

    https://jingyan.baidu.com/article/f3ad7d0fe5d31309c3345b9b.html

  8. layui table指定某一行样式

    1.想指定layui table中某一行的样式,找了这个资源可行.转自: https://blog.csdn.net/weixin_44729896/article/details/100524824 ...

  9. leetcode434 字符串中的单词树(python)

    统计字符串中的单词个数,这里的单词指的是连续的不是空格的字符. 请注意,你可以假定字符串里不包括任何不可打印的字符. 示例: 输入: "Hello, my name is John" ...

  10. ES6标准入门 第四章:字符串的扩展

    1.字符串的Unicode 表示法 JavaScript 允许采用 \uxxxx 表示一个字符,其中 xxxx 表示字符的码点. "\u0061" // "a" ...