Scalding初探之一:基于Scala的Hadoop利器

本文介绍使用Scala语言进行大数据处理的Scalding框架,通过示例程序展示如何利用Scalding简化MapReduce任务,同时提供了丰富的资源链接帮助读者深入学习。

把你从写繁琐的Map-reduce Job中解放出来,写分布式跟写本地程序没两样,Scala真真代表着先进生产力的方向啊。

好的,今天开始直播基于Scala的Scalding啦,循序渐进地看以下页面: 

https://github.com/twitter/scalding#scalding

https://github.com/twitter/scalding/wiki/Getting-Started

https://github.com/willf/scalding_cookbook

看到scalding-cookbook的时候,可以开始尝试写比Word Count更酷的Scalding程序了

 1 import com.twitter.scalding._  2
 3 // input (tsv)  4 // 0 1 2 3 4 5 6  5 // 22 kinds of love nn2 io nn1  6 // 12 large green eyes jj jj nn2  7 //
 8 // output (tsv)  9 // 22 of kinds/nn2_love/nn1 10 // 12 green large/jj_eyes/nn2
11
12 class contextCountJob(args : Args) extends Job(args) { 13   val inSchema = ('count, 'w1 ,'w2, 'w3, 'pos1, 'pos2, 'pos3)
14   val outSchema = ('count, 'word, 'context)
15   Tsv(args("input"),inSchema) 16     .mapTo(inSchema -> outSchema) { 17       parts : (String, String, String, String, String, String, String) => { 18         val (count, w1, w2, w3, pos1, pos2, pos3) = parts 19         val context = "%s/%s_%s/%s".format(w1,pos1,w3,pos3) 20  (count, w2, context) 21  } 22  } 23   .write(Tsv(args("output"))) 24 }

比较糟糕的是Scala语言新潮到博客园插件都不支持。。。

http://docs.kiji.org/userguides/express/1.0.1/basic-scala-scalding/

http://sujitpal.blogspot.com/2012/08/scalding-for-impatient.html

https://github.com/sujitpal/hia-examples/tree/master/scala/scalding-impatient/src/main/scala/com/mycompany/impatient

https://github.com/twitter/scalding/wiki/Fields-based-API-Reference

https://github.com/twitter/scalding/wiki/Scalding-Sources

https://github.com/twitter/scalding/wiki/Field-rules

https://github.com/twitter/scalding/wiki/API-Reference

https://github.com/twitter/scalding/wiki

http://twitter.github.io/scalding/com/twitter/scalding/package.html

https://github.com/deanwampler/scalding-workshop

推荐Twitter公开课的PPT(此处应有FQ)

 

可以对比下其他Hadoop框架

 

 

转载于:https://www.cnblogs.com/wei-li/p/ScaldingFirstSight.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值