[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. POJ 3260 The Fewest Coins(完全背包+多重背包=混合背包)

    题目代号:POJ 3260 题目链接:http://poj.org/problem?id=3260 The Fewest Coins Time Limit: 2000MS Memory Limit: ...

  2. 快速排序和二分查找(Javascript)

    var data = [8, 3, 4, 1, 18, 22, 11, 3, 5, 6, 2, 1, 77] quickSort(data, 0, data.length - 1) console.l ...

  3. node.js npm 操作 模块化开发 cnpm镜像安装

    模块(包) 传统引入 js 的缺点 整个网页,我们写了一个 js 文件,所有的特效都在里面 耦合度太高,代码之间关联性太强,不便于后期维护 变量容易 全局污染 如果将 复杂的 js 文件,拆成多个功能 ...

  4. leetcode-mid-sorting and searching - 33. Search in Rotated Sorted Array

    mycode class Solution(object): def search(self, nums, target): """ :type nums: List[i ...

  5. leetcode-mid-backtracking -22. Generate Parentheses-NO

    mycode    没有思路,大早上就有些萎靡,其实和上一个电话号码的题如出一辙啦 参考: class Solution(object): def generateParenthesis(self, ...

  6. Python深度学习读书笔记-3.神经网络的数据表示

    标量(0D 张量) 仅包含一个数字的张量叫作标量(scalar,也叫标量张量.零维张量.0D 张量).在Numpy 中,一个float32 或float64 的数字就是一个标量张量(或标量数组).你可 ...

  7. 常量const实践

    这篇文章写的很好:https://www.cnblogs.com/zhangfeionline/p/5882790.html 自己是实践: 1. 定义时必须初始化值,不然如下错误: 2. 3. 使用:

  8. 十一、RF操作滚动条

    两种方式: 方式一:window.scrollBy(0, document.body.scrollHeight) 方式二:window.scrollTo(0, document.body.scroll ...

  9. 旋转数组 空间复杂度为O(1) 的2 种方法 + 1种空间复杂度O(n)

    题目地址 : 旋转数组. 网上好多不是根本就是错的,就是空间复杂度不是真正为1 下面总结一下 方法1 普通方法(空间复杂度不满足要求,但是题目并不会判错,说明他们没用对空间进行校验) ··· publ ...

  10. JS关于this指向的小练习

    请阅读以下代码:var obj = {};obj.log = console.log;obj.log.call(console, this)该代码在浏览器中执行,输出的日志结果是什么? 这道题就是问c ...