代码改变世界

Scala 学习笔记

2014-05-13 16:07 by briller, 148 阅读, 0 推荐, 收藏, 编辑
摘要:class Rational(n: Int, d: Int) { require(d != 0) override def toString = n +"/"+ d}The require method takes one boolean parameter. If the passed val... 阅读全文

Flume + hadoop 2.2

2014-04-30 11:46 by briller, 172 阅读, 0 推荐, 收藏, 编辑
摘要:替换jar 包protobuf-java-2.5.0.jarguava-11.0.2.jar 因为hadoop2.2使用了protobuf 2.5目前file channel 到 hdfs sink还会报错 阅读全文

遇到的hive问题,fixed in 0.12

2014-04-10 21:39 by briller, 209 阅读, 0 推荐, 收藏, 编辑
摘要:https://issues.apache.org/jira/browse/HIVE-5085一个hiveserver2的客户端 pyhs2需要安装libsasl2-dev 阅读全文

Hive alter column 问题

2014-04-03 10:40 by briller, 776 阅读, 0 推荐, 收藏, 编辑
摘要:Hive Alter column 没有删除,只有REPLACE,在使用非内置的SERDE时可能无法使用RPLACE COLUMNS。目前使用JSON SERDE时,会发现如果使用external table时只是在create时能保证字段与列对应正确,当ALTER后就不正确。只好改成了managed table 阅读全文

屌丝javascript Date 解析字符串的错误(可能是错误)

2014-03-14 11:56 by briller, 170 阅读, 0 推荐, 收藏, 编辑
摘要:d = new Date("2014-03-08") Sat Mar 08 2014 08:00:00 GMT+0800 (CST)d = new Date("2014/03/08") Sat Mar 08 2014 00:00:00 GMT+0800 (CST)不同分割符出来的时间还不一样,TMD是在逗我么 阅读全文

pymongo

2014-02-27 10:42 by briller, 144 阅读, 0 推荐, 收藏, 编辑
摘要:collectoin.updata({},{"$set":{}},multi=True)默认multi为False,只更新match 的第一条数据 阅读全文

About Lua And Nginx

2014-02-12 17:23 by briller, 313 阅读, 0 推荐, 收藏, 编辑
摘要:在控制结构的条件中除了 false 和 nil 为假,其他值都为真。所以 Lua 认为 0 和空串都是真location /report.gif { default_type image/gif; set $u_uid ''; set $u_sid ''; set $u_lsid ''; set $u_appsid ''; access_log /var/log/nginx/lua/lua.log tick; access_by_lua_file /etc/nginx/lua/log.lua; add_header Expires 阅读全文

Streaming InputFormat相关

2014-02-11 17:47 by briller, 252 阅读, 0 推荐, 收藏, 编辑
摘要:Streaming 默认时是 org.apache.hadoop.mapred.TextInputFormat当Streaming -inputformat 设置为org.apache.hadoop.mapred.KeyValueTextInputFormat会自动变成StreamInputFormat (which extends KeyValueTextInputFormat) 阅读全文

HIVE outer join TIPS

2014-02-08 12:05 by briller, 541 阅读, 0 推荐, 收藏, 编辑
摘要:OUTER JOIN GotchaBefore we discuss the other outer joins, let’s discuss a gotcha you should understand.JOIN Statements | 101Recall what we said previously about speeding up queries by adding partition filters inthe WHERE clause. To speed up our previous query, we might choose to add predicatesthat s 阅读全文

Hive TIPS

2014-02-07 17:25 by briller, 298 阅读, 0 推荐, 收藏, 编辑
摘要:LOAD DATA LOCAL INPATH '${env:HOME}/california-employees'OVERWRITE INTO TABLE employeesPARTITION (country = 'US', state = 'CA');If the LOCAL keyword is used, the path is assumed to be in the local filesystem. The datais copied into the final location. If LOCAL is omitted, the 阅读全文