sh 执行hive 查询 [文件名 要看全] -1
2016-07-27 20:01
399 查看
[root@BDC3 pn_result]# su - edaa [edaa@BDC3 ~]$ pwd /dfs/ftp/edaa [edaa@BDC3 ~]$ ll total 4380 -rw-r--r-- 1 edaa edaa 2013 Jul 27 17:02 451208_.txt drwxr-xr-x 5 edaa edaa 4096 Jun 29 19:22 app_test -rwxr-xr-x 1 edaa edaa 21994 Apr 22 14:38 bigkg.txt drwxr-xr-x 2 edaa edaa 4096 Jun 26 19:07 contest_data drwxr-xr-x 5 edaa edaa 4096 Jul 19 18:05 ddr_2_dpi drwxr-xr-x 5 edaa edaa 4096 Mar 11 18:08 ddr_2_dpi_no_com drwxr-xr-x 5 edaa edaa 4096 Feb 17 18:30 ddr_2_dpi_pn drwxr-xr-x 5 edaa edaa 4096 Apr 21 09:10 ddr_2_dpi_yd drwxr-xr-x 5 edaa edaa 4096 Mar 21 14:45 ddr_2_dpi_yd_no34g -rw-rw-r-- 1 edaa edaa 635 Jul 12 17:26 derby.log drwxr-xr-x 2 edaa edaa 4096 Dec 28 2015 dpi_jiqie drwxr-xr-x 2 edaa edaa 4096 Jun 28 22:46 group_test -rwxr-xr-x 1 edaa edaa 910160 Jun 23 20:40 group_test.tgz drwxr-xr-x 3 edaa edaa 4096 May 16 16:50 hbase -rwxr-xr-x 1 edaa edaa 4106 Feb 24 17:30 MaxTemperature.jar drwxrwxr-x 5 edaa edaa 4096 Jul 12 17:26 metastore_db drwxrwxr-x 3 edaa edaa 4096 Jul 27 18:10 pn_20160727 -rw-rw-r-- 1 edaa edaa 345504 Jul 12 17:41 result_1000_3g_dpi.txt -rw-rw-r-- 1 edaa edaa 322072 Jul 12 17:47 result_1000_4g_dpi.txt drwxr-xr-x 2 edaa edaa 4096 May 5 10:48 sgn_onoff drwxr-xr-x 10 edaa edaa 4096 Jan 23 2016 spark-1.3.0-bin-hadoop2.4 drwxr-xr-x 12 edaa edaa 4096 Jul 13 18:11 spark-1.6.2-bin-hadoop2.4 drwxrwxr-x 2 edaa edaa 4096 Jul 18 14:41 ua_20160717 drwxrwxr-x 2 edaa edaa 4096 Jul 19 18:06 ua_20160718 -rw-rw-r-- 1 edaa edaa 2787335 Jul 21 14:02 ua_20160718.tgz [edaa@BDC3 ~]$ cd pn_20160727/ [edaa@BDC3 pn_20160727]$ ll total 7172 -rw-rw-r-- 1 edaa edaa 737 Jul 27 17:21 pn_20160727_sql.sh drwxrwxr-x 2 edaa edaa 4096 Jul 27 17:54 pn_result -rw-rw-r-- 1 edaa edaa 7332361 Jul 27 18:10 pn_result.tgz -rw-rw-r-- 1 edaa edaa 0 Jul 27 17:22 run.log [edaa@BDC3 pn_20160727]$ cd pn_result [edaa@BDC3 pn_result]$ ll total 34696 -rw-r--r-- 1 edaa edaa 34620159 Jul 27 17:54 000000_0 -rw-r--r-- 1 edaa edaa 902320 Jul 27 17:54 000001_0 [edaa@BDC3 pn_result]$ cat 00000_0 cat: 00000_0: No such file or directory [edaa@BDC3 pn_result]$ less 000001_0 [edaa@BDC3 pn_result]$ less 000000_0 [edaa@BDC3 pn_result]$ pwd /dfs/ftp/edaa/pn_20160727/pn_result [edaa@BDC3 pn_result]$ id uid=512(edaa) gid=511(edaa) groups=511(edaa) [edaa@BDC3 pn_result]$ ok -bash: ok: command not found [edaa@BDC3 pn_result]$ ok -bash: ok: command not found [edaa@BDC3 pn_result]$ pwd /dfs/ftp/edaa/pn_20160727/pn_result [edaa@BDC3 pn_result]$ exit; logout [root@BDC3 pn_result]# pwd /dfs/ftp/edaa/pn_20160727/pn_result [root@BDC3 pn_result]# ll total 34696 -rw-r--r-- 1 edaa edaa 34620159 Jul 27 17:54 000000_0 -rw-r--r-- 1 edaa edaa 902320 Jul 27 17:54 000001_0 [root@BDC3 pn_result]# less 00000 000000_0 000001_0 [root@BDC3 pn_result]# less 00000 000000_0 000001_0 [root@BDC3 pn_result]# less 00000 000000_0 000001_0 [root@BDC3 pn_result]# less 00000 000000_0 000001_0 [root@BDC3 pn_result]# less 00000 000000_0 000001_0 [root@BDC3 pn_result]# less 000000_0 [root@BDC3 pn_result]# less 000001_0 [root@BDC3 pn_result]# pwd /dfs/ftp/edaa/pn_20160727/pn_result [root@BDC3 pn_result]# ok -bash: ok: command not found [root@BDC3 pn_result]# ll total 34696 -rw-r--r-- 1 edaa edaa 34620159 Jul 27 17:54 000000_0 -rw-r--r-- 1 edaa edaa 902320 Jul 27 17:54 000001_0 [root@BDC3 pn_result]# cd . [root@BDC3 pn_result]# cd .. [root@BDC3 pn_20160727]# ll total 7172 -rw-rw-r-- 1 edaa edaa 737 Jul 27 17:21 pn_20160727_sql.sh drwxrwxr-x 2 edaa edaa 4096 Jul 27 17:54 pn_result -rw-rw-r-- 1 edaa edaa 7332361 Jul 27 18:10 pn_result.tgz -rw-rw-r-- 1 edaa edaa 0 Jul 27 17:22 run.log [root@BDC3 pn_20160727]# cat pn_20160727_sql.sh #!/bin/sh sql=" set mapreduce.job.queuename=datagather; use edaa; insert overwrite local directory '/dfs/ftp/edaa/pn_20160727/pn_result' row format delimited fields terminated by ',' select pn.pn,dpi_3g.capturetime,dpi_3g.endtime,dpi_3g.flowall,dpi_3g.url,'3G' as net_type from edaa.pn_20160727 pn left outer join (select mdn,capturetime,endtime,flowall,url from ssa.t_source_dpi_3g where clndr_dt_id='20160727') dpi_3g on pn.pn=dpi_3g.mdn union all select pn.pn,dpi_4g.capturetime,dpi_4g.endtime,dpi_4g.flowall,dpi_4g.url,'4G' as net_type from edaa.pn_20160727 pn left outer join (select mdn,capturetime,endtime,flowall,url from ssa.t_source_dpi_4g where clndr_dt_id='20160727') dpi_4g on pn.pn=dpi_4g.mdn; exit;" hive -S -e "$sql" [root@BDC3 pn_20160727]#
相关文章推荐
- android wifi 无线调试
- 运维入门
- 动态清空 nohup 输出文件
- install scrapy with pip and easy_install
- 分享Hive的一份胶片资料
- Linux Shell常用技巧
- Shell 脚本编程陷阱
- Hadoop生态上几个技术的关系与区别:hive、pig、hbase 关系与区别
- shell字符串操作详解
- Shell中删除某些文件外所有文件的3个方法
- Ruby中执行Linux shell命令的六种方法详解
- VB使用shell函数打开外部exe程序的实现方法
- Shell编程的一些知识集合
- Shell中的for和while循环详细总结
- 什么是Shell?Shell脚本基础知识详细介绍
- Shell脚本中引用、调用另一个脚本文件的2种方法
- Shell脚本解压rpm软件包
- Linux Shell 数组建立及使用技巧
- Shell脚本实现复制文件到多台服务器的代码分享
- Shell脚本实现批量替换文件内容