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相关操作的更多相关文章

  1. HBase Cli相关操作

    修改HBase表结构之前首先需要disable表,然后进行更改相关表结构信息,最后enable表,如下 1. 动态添加一个或多个列簇 hbase(main):034:0> describe 'H ...

  2. Hive(八)Hive的Shell操作与压缩存储

    一.Hive的命令行 1.Hive支持的一些命令 Command Description quit Use quit or exit to leave the interactive shell. s ...

  3. hive cli 启动缓慢问题

    hive-0.13.1启动缓慢的原因 发现时间主要消耗在以下3个地方: 1. hadoopjar的时候要把相关的jar包上传到hdfs中(这里大概消耗5s,hive0.11一样,这个地方不太好优化) ...

  4. [转帖]我最近研究了hive的相关技术,有点心得,这里和大家分享下。

    我最近研究了hive的相关技术,有点心得,这里和大家分享下. https://www.cnblogs.com/sharpxiajun/archive/2013/06/02/3114180.html 首 ...

  5. Hive cli源码阅读和梳理

    对Cli的重新认识*). hive cli有两种模式, 本地模式: 采用持有的driver对象来处理, 远程模式: 通过连接HiveServer来实现, 由此可见之前的架构图中的描述还是模糊且带有误导 ...

  6. hive 桶相关特性分析

    1. hive 桶相关概念     桶(bucket)是指将表或分区中指定列的值为key进行hash,hash到指定的桶中,这样可以支持高效采样工作.     抽样( sampling )可以在全体数 ...

  7. 从零自学Hadoop(24):Impala相关操作上

    阅读目录 序 数据库相关 表相关 系列索引 本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,SourceLink 序 ...

  8. 【转】Reflector、reflexil、De4Dot、IL相关操作指令合集

    PS:CTRL+F 输入你需要的内容,可以快速查找页面上的内容. 名称 说明 Add 将两个值相加并将结果推送到计算堆栈上. Add.Ovf 将两个整数相加,执行溢出检查,并且将结果推送到计算堆栈上. ...

  9. nova相关操作的Request_Id的获取

    在分析nova的众多log文件时,如nova-api,nova-scheduler,nova-compute等,其中的request id是串联起整个flow的关键词. 而通过nova instanc ...

随机推荐

  1. arduino 驱动电调

    #include <TimerOne.h> #define PPMPIN 7 ; //0-9 ; void setup() { // put your setup code here, t ...

  2. try-catch+thows异常范围说明

    方式一: CatalogPO deleteTarget = null; /** 查询是否存在 **/ deleteTarget = catalogMapper.findByCatalogId(cata ...

  3. if_elseif

    用MATLAB写了个这样的程序 if ((0 < pwr <=2) ) wf_temp1 = round(temp_wf0/2^7); elseif( (2 < pwr<= 4 ...

  4. 关于on commit preserve rows与on commit delete rows的测试

    1:先分别建立两张表 sql> CREATE GLOBAL TEMPORARY TABLE tmp_session on commit preserve rows as select * fro ...

  5. 大文件上传插件webupload插件

    版权所有 2009-2018荆门泽优软件有限公司 保留所有权利 官方网站:http://www.ncmem.com/ 产品首页:http://www.ncmem.com/webapp/up6.2/in ...

  6. 如何将word中的图片和文字导入自己的博客中

    目前大部分的博客作者在用Word写博客这件事情上都会遇到以下3个痛点: 1.所有博客平台关闭了文档发布接口,用户无法使用Word,Windows Live Writer等工具来发布博客.使用Word写 ...

  7. afx_msg解释

    以前一直不知道AFX_MSG是什么意思,只是觉得它应该是个消息映射函数,但是具体代表什么意思,会返回一个什么样的值是一点都不清楚,今天查了下资料,把查到的东西放这,以免以后忘了还得再查. 在头文件(D ...

  8. 日期函数、时间函数总结(MySQL 5.X)

    一.MySQL 获得当前日期时间 函数1.1 获得当前日期+时间(date + time)函数:now()mysql> select now(); +---------------------+ ...

  9. Difference between the Bill of distribution and sourcing rule.

        https://forums.oracle.com/thread/936768 This is from a users guide  Oracle Supply Chain Planning ...

  10. Redis键迁移

    Redis键迁移   在使用Redis的过程中,很多时候我们会遇到需要进行键迁移的问题,需要将指定Redis中的指定数据迁移到其他Redis当中,键迁移有三种方法,我们来进行一一介绍. 一.move ...