Hive Cli相关操作
landen@Master:~/UntarFile/hive-0.10.0$ bin/hive --database 'stuchoosecourse' -e 'select * from hiddenipinfo'
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/landen/UntarFile/hive-0.10.0/lib/hive-common-0.10.0.jar!/hive-log4j.properties
Hive history file=/home/landen/UntarFile/hive-0.10.0/logs/hive_job_log_landen_201312091443_1939478442.txt
OK
Time taken: 2.704 seconds
OK
ip countrycode countryname region regionname city latitude longitude timezone
221.12.10.218 CN China 02 Zhejiang Hangzhou 30.293594 120.16141 Asia/Shanghai
60.180.248.201 CN China 02 Zhejiang Wenzhou 27.999405 120.66681 Asia/Shanghai
125.111.251.118 CN China 02 Zhejiang Ningbo 29.878204 121.5495 Asia/Shanghai
Time taken: 0.813 seconds
testSql.q内容如下:
select IP4Tocc(ipadress,'./GeoLiteCity.dat') from ipidentifier;
select * from hiddenipinfo;
landen@Master:~/UntarFile/hive-0.10.0$ bin/hive --database 'stuchoosecourse' -f '/home/landen/文档/testSql.q'(执行SQL文件)
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/landen/UntarFile/hive-0.10.0/lib/hive-common-0.10.0.jar!/hive-log4j.properties
Hive history file=/home/landen/UntarFile/hive-0.10.0/logs/hive_job_log_landen_201312091450_505292945.txt
OK
Time taken: 4.939 seconds
Total MapReduce jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_201312042044_0024, Tracking URL = http://Master:50030/jobdetails.jsp?jobid=job_201312042044_0024
Kill Command = /home/landen/UntarFile/hadoop-1.0.4/libexec/../bin/hadoop job -kill job_201312042044_0024
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
2013-12-09 14:51:19,055 Stage-1 map = 0%, reduce = 0%
2013-12-09 14:51:25,127 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.21 sec
2013-12-09 14:51:26,133 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.21 sec
2013-12-09 14:51:27,156 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.21 sec
2013-12-09 14:51:28,160 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.21 sec
2013-12-09 14:51:29,164 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.21 sec
2013-12-09 14:51:30,168 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.21 sec
2013-12-09 14:51:31,172 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 1.21 sec
MapReduce Total cumulative CPU time: 1 seconds 210 msec
Ended Job = job_201312042044_0024
MapReduce Jobs Launched:
Job 0: Map: 1 Cumulative CPU: 1.21 sec HDFS Read: 306 HDFS Write: 188 SUCCESS
Total MapReduce CPU Time Spent: 1 seconds 210 msec
OK
_c0
CN China 02 Zhejiang Hangzhou 30.293594 120.16141 Asia/Shanghai
CN China 02 Zhejiang Wenzhou 27.999405 120.66681 Asia/Shanghai
CN China 02 Zhejiang Ningbo 29.878204 121.5495 Asia/Shanghai
Time taken: 47.517 seconds
OK
ip countrycode countryname region regionname city latitude longitude timezone
221.12.10.218 CN China 02 Zhejiang Hangzhou 30.293594 120.16141 Asia/Shanghai
60.180.248.201 CN China 02 Zhejiang Wenzhou 27.999405 120.66681 Asia/Shanghai
125.111.251.118 CN China 02 Zhejiang Ningbo 29.878204 121.5495 Asia/Shanghai
Time taken: 0.441 seconds
landen@Master:~/UntarFile/hive-0.10.0$
hive (stuchoosecourse)> source /home/landen/文档/testSql.q(执行SQL文件);
Total MapReduce jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_201312042044_0025, Tracking URL = http://Master:50030/jobdetails.jsp?jobid=job_201312042044_0025
Kill Command = /home/landen/UntarFile/hadoop-1.0.4/libexec/../bin/hadoop job -kill job_201312042044_0025
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
2013-12-09 15:04:16,330 Stage-1 map = 0%, reduce = 0%
2013-12-09 15:04:25,390 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.39 sec
2013-12-09 15:04:26,420 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.39 sec
2013-12-09 15:04:27,455 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.39 sec
2013-12-09 15:04:28,467 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.39 sec
2013-12-09 15:04:29,470 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.39 sec
2013-12-09 15:04:30,479 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.39 sec
2013-12-09 15:04:31,485 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 2.39 sec
MapReduce Total cumulative CPU time: 2 seconds 390 msec
Ended Job = job_201312042044_0025
MapReduce Jobs Launched:
Job 0: Map: 1 Cumulative CPU: 2.39 sec HDFS Read: 306 HDFS Write: 188 SUCCESS
Total MapReduce CPU Time Spent: 2 seconds 390 msec
OK
_c0
CN China 02 Zhejiang Hangzhou 30.293594 120.16141 Asia/Shanghai
CN China 02 Zhejiang Wenzhou 27.999405 120.66681 Asia/Shanghai
CN China 02 Zhejiang Ningbo 29.878204 121.5495 Asia/Shanghai
Time taken: 72.463 seconds
OK
ip countrycode countryname region regionname city latitude longitude timezone
221.12.10.218 CN China 02 Zhejiang Hangzhou 30.293594 120.16141 Asia/Shanghai
60.180.248.201 CN China 02 Zhejiang Wenzhou 27.999405 120.66681 Asia/Shanghai
125.111.251.118 CN China 02 Zhejiang Ningbo 29.878204 121.5495 Asia/Shanghai
Time taken: 0.133 seconds
hive (default)> add file /home/landen/UntarFile/GeoIP/GeoLiteCity.dat;
Added resource: /home/landen/UntarFile/GeoIP/GeoLiteCity.dat
hive (default)> add jar /home/landen/UntarFile/hive-0.10.0/lib/IPTocc.jar jar1 jar2 ...;
Added /home/landen/UntarFile/hive-0.10.0/lib/IPTocc.jar to class path
Added resource: /home/landen/UntarFile/hive-0.10.0/lib/IPTocc.jar
hive (default)> create temporary function IP4Tocc as 'org.hadoop.hive.additionalUDF.IPToCC';
hive (stuchoosecourse)> list jars;
/home/landen/UntarFile/hive-0.10.0/lib/IPTocc.jar
file:/home/landen/UntarFile/hive-0.10.0/lib/hive-builtins-0.10.0.jar
hive (stuchoosecourse)> show tables '*ip*';
OK
tab_name
hiddenipinfo
ipidentifier
Time taken: 3.727 seconds
hive (stuchoosecourse)>
其它相关hive cli操作:http://www.cnblogs.com/tangtianfly/archive/2012/11/02/2751815.html
Hive Cli相关操作的更多相关文章
- HBase Cli相关操作
修改HBase表结构之前首先需要disable表,然后进行更改相关表结构信息,最后enable表,如下 1. 动态添加一个或多个列簇 hbase(main):034:0> describe 'H ...
- Hive(八)Hive的Shell操作与压缩存储
一.Hive的命令行 1.Hive支持的一些命令 Command Description quit Use quit or exit to leave the interactive shell. s ...
- hive cli 启动缓慢问题
hive-0.13.1启动缓慢的原因 发现时间主要消耗在以下3个地方: 1. hadoopjar的时候要把相关的jar包上传到hdfs中(这里大概消耗5s,hive0.11一样,这个地方不太好优化) ...
- [转帖]我最近研究了hive的相关技术,有点心得,这里和大家分享下。
我最近研究了hive的相关技术,有点心得,这里和大家分享下. https://www.cnblogs.com/sharpxiajun/archive/2013/06/02/3114180.html 首 ...
- Hive cli源码阅读和梳理
对Cli的重新认识*). hive cli有两种模式, 本地模式: 采用持有的driver对象来处理, 远程模式: 通过连接HiveServer来实现, 由此可见之前的架构图中的描述还是模糊且带有误导 ...
- hive 桶相关特性分析
1. hive 桶相关概念 桶(bucket)是指将表或分区中指定列的值为key进行hash,hash到指定的桶中,这样可以支持高效采样工作. 抽样( sampling )可以在全体数 ...
- 从零自学Hadoop(24):Impala相关操作上
阅读目录 序 数据库相关 表相关 系列索引 本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,SourceLink 序 ...
- 【转】Reflector、reflexil、De4Dot、IL相关操作指令合集
PS:CTRL+F 输入你需要的内容,可以快速查找页面上的内容. 名称 说明 Add 将两个值相加并将结果推送到计算堆栈上. Add.Ovf 将两个整数相加,执行溢出检查,并且将结果推送到计算堆栈上. ...
- nova相关操作的Request_Id的获取
在分析nova的众多log文件时,如nova-api,nova-scheduler,nova-compute等,其中的request id是串联起整个flow的关键词. 而通过nova instanc ...
随机推荐
- springcloud-eureka简单实现
请参考 spring+cloud为服务实战 第三章 一.创建Eureka服务 1.使用Idea创建一个项目 结构如下: 2.pom.xml配置: <?xml version="1.0& ...
- C#与android连接 SimpleWifi
有时候 Read时会返回0长度 ----- 当连续2次每读到数据时,建议发个心跳信息,然后单片机给个回复 C# using System; using System.Collections.Gener ...
- Tomcat & SVN
1. Tomcat简介 tomcat是一个web服务器,类似nginx,apache的http nginx,http只能处理html等静态文件(jpg) 网页分为静态网页(以.html或者.htm结尾 ...
- js,java,jstl多分隔符分割字符串
1.js多分隔符 分割字符串 var username = “zhao,li;wang.liu”: var arr = str.split(/;|:|,|,|./); 括号里面可以写多分割符号,中英 ...
- Field '***********' doesn't have a default value
今天做配置文件一直报这个错误: 原因是主键是integer类型,没有设置自增模式,所以会出现这个问题,是表的结构问题.更改用navicat
- UVa 1638 Pole Arrangement (递推或DP)
题意:有高为1,2,3...n的杆子各一根排成一行,从左边能看到L根,从右边能看到R根,求杆子的排列有多少种可能. 析:设d(i, j, k)表示高度为1-i的杆子排成一行,从左边看到j根,从右边看到 ...
- python 的几种启动方式
python 的几种启动方式 (1)利用Win的操作系统的:命令行工具 cmd.exe Win + R 调出运行对话框,然后输入cmd,即可调出“命令提示符对话框” 或者 在菜单中店家附件中的命令提 ...
- 团队项目(HCL队)第二周
一.项目介绍 1.内容 我们队选择的题目是经典90坦克大战的java实现,后续会加入ai,以实现更丰富的体验. 2.预期使用数量 原版的经典90坦克大战拥有众多粉丝,我们在其上进行拓展,目前预计用户量 ...
- Python学习-25.Python中的分数
在Python中,不止有浮点数(float),而且还有分数(Fraction)这个类型. 要使用分数,必须引入一个模块. import fractions 然后就可以声明一个分数了 x = fract ...
- WPF Auto LogOff
Implementation of Auto Logoff Based on User Inactivity in WPF Application http://www.codeproject.com ...