2014年9月10日

notepad++ 必装插件

摘要: nppftp ;FTP客户端,你懂的;explorer:设置常用文件链接;打开当前文件路径; 阅读全文

posted @ 2014-09-10 10:21 a_badegg 阅读(203) 评论(0) 推荐(0) 编辑

2014年9月9日

linux 分割文件

摘要: import os import sysimport subprocessif len(sys.argv)' + file_name + '_split_' + str(i)) os.system('sed \'1,' + str(split_num) + 'd\' ' + file_name ... 阅读全文

posted @ 2014-09-09 15:04 a_badegg 阅读(225) 评论(0) 推荐(0) 编辑

2014年9月5日

oracle 导入txt

摘要: 没有Oraclehoume的情况下,执行下环境变量文件sqlldr userid= DM/DM control = /home/oracle/libc/load.ctlload data infile '/home/oracle/libc/data.txt' ... 阅读全文

posted @ 2014-09-05 14:10 a_badegg 阅读(606) 评论(0) 推荐(0) 编辑

2014年8月30日

hive 使用脚本清洗数据:时间戳转日期

摘要: import sysimport datetimefor line in sys.stdin: line = line.strip() userid, movieid, rating, unixtime = line.split('\t') weekday = datetime.datetim... 阅读全文

posted @ 2014-08-30 22:52 a_badegg 阅读(1802) 评论(0) 推荐(0) 编辑

2014年8月29日

指定hive输出格式

摘要: 0.11版本以前:sed -e 's/\x01/|/g' file0.11版本以后:insert overwrite local directory '/opt/aimcpro/libc/test.txt' row format delimited fields terminated by '|'... 阅读全文

posted @ 2014-08-29 17:23 a_badegg 阅读(1344) 评论(0) 推荐(0) 编辑

hive j简单邮件过滤

摘要: select min(call_log), a.mail_subject from (select mail_to,mail_subject from dw_user_deviler_201408 where log_date>=20140825 and mail_subject not ... 阅读全文

posted @ 2014-08-29 15:11 a_badegg 阅读(191) 评论(0) 推荐(0) 编辑

hive 行转列 并添加虚列

摘要: select regexp_extract(a.col2,'(phonenum=\")(.*?)\"',2) user_device, regexp_extract(a.col13,'(imsicode=\")(.*?)\"',2) imsi, regexp_extract(a.col12,... 阅读全文

posted @ 2014-08-29 11:38 a_badegg 阅读(280) 评论(0) 推荐(0) 编辑

2014年8月28日

hive join 优化

摘要: common join : 即reducer join,瓶颈在shuffle阶段,会产生较大的网络io;map join:即把小表放前面,扫描后放入每个节点的内存,在map阶段进行匹配;开启map join:set hive.auto.convert.join = true;hive.mapjoin... 阅读全文

posted @ 2014-08-28 15:36 a_badegg 阅读(287) 评论(0) 推荐(0) 编辑

2014年8月27日

left outer join

摘要: tableA:Field_K,Field_A1a3b4ctableB:Field_K,Field_B1x2y4zselecta.Field_K,a.Field_A,b.Field_K,b.Field_Bfromaleft outer joinbona.Field_K=b.Field_KField_K... 阅读全文

posted @ 2014-08-27 15:42 a_badegg 阅读(162) 评论(0) 推荐(0) 编辑

2014年8月26日

Linux 文件内容转码

摘要: 文件内容的转换:iconv -f GB2312 -t UTF-8 gb1.txt >gb2.txt-f, –from-code=名称 原始文本编码-t, –to-code=名称 输出编码-o, –output=FILE 输出文件-l 或者 –list 查看目前支持的编码。 阅读全文

posted @ 2014-08-26 09:55 a_badegg 阅读(413) 评论(0) 推荐(0) 编辑

导航