GithubHelp home page GithubHelp logo

code-experience's People

Contributors

nycleaner avatar

Watchers

 avatar  avatar

code-experience's Issues

一些常用的资料

Spark 问题

1.(http://www.cnblogs.com/porco/p/4642434.html)

假设[1,2,3,4]被分成两个分区,为 分区1([1,2]),分区2([3,4])
首先用seqOp对分区1进行操作:
x=(0,0) y=1 -----> (1,1) #对分区进行第一次seqOp操作时,x为zero value
x=(1,1) y=2 -----> (3,2) #对分区进行的第二次及以后的seqOp操作,x为前一次seqOp的执行结果
同样对分区2进行操作:
x=(0,0) y=3 -----> (3,1)
x=(3,1) y=4 -----> (7,2)
然后用combOp对两个分区seqOp作用后的结果进行操作:
分区1:
x=(0,0) y=(3,2) ------> (3,2) #对第一个分区进行combOp操作时,x为zero value
x=(3,2) y=(7,2) ------> (10,4) #对第二个及以后分区进行combOp操作时,x为前一分区combOp处理后的结果
可以看出,例子实际上即 (rdd.sum(),rdd.count())
aggregate的作用大概是对每个partition应用seqOp操作和combOp操作,然后对这个由各个partitions的结果构成的结果空间再做一次combOp。zeroValue是初值,seqOp输入U和T,U的初值就是zeroValue,T是RDD的element,seqOp对每个element操作的结果作为下一个element的U。combOp的输入是U1,U2,其中U1的初值是zeroValue,U2是各个partitions的输出。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.