Comments (2)
cogroup有一个可选参数指定task数,这个task数是不是就是partition数呢?
from sparkinternals.
我看CogroupRDD的实现,没看懂narrowdependency或shuffledependency对cogrouprdd中partition的影响... 不知道如果a.cogroup(b) , a分别是rangepartitioner和hashpartitioner的话,中间生成的cogrouprdd的分区数莫非和rdd a的一样多?因为cogroup这个算子不能指定numPartitons呀
我看您在JobLogicalPlan章节中对dependency分了4类(或者说两打类), 而且看cogroupRDD的对于依赖的处理,似乎并没有这么复杂,完全无视了所谓的N:1 NarrowDependency。override def compute(s: Partition, context: TaskContext): Iterator[(K, Array[Iterable[_]])] = {
val sparkConf = SparkEnv.get.conf
val externalSorting = sparkConf.getBoolean("spark.shuffle.spill", true)
val split = s.asInstanceOf[CoGroupPartition]
val numRdds = dependencies.length// A list of (rdd iterator, dependency number) pairs val rddIterators = new ArrayBuffer[(Iterator[Product2[K, Any]], Int)] for ((dep, depNum) <- dependencies.zipWithIndex) dep match { case oneToOneDependency: OneToOneDependency[Product2[K, Any]] @unchecked => val dependencyPartition = split.narrowDeps(depNum).get.split // Read them from the parent val it = oneToOneDependency.rdd.iterator(dependencyPartition, context) rddIterators += ((it, depNum)) case shuffleDependency: ShuffleDependency[_, _, _] => // Read map outputs of shuffle val it = SparkEnv.get.shuffleManager .getReader(shuffleDependency.shuffleHandle, split.index, split.index + 1, context) .read() rddIterators += ((it, depNum)) }
hi,你看懂了吗,我也不懂这个,为什么分区器相同就是一对一依赖,并且还可能产生 shuffle(因为划分了 stage)
from sparkinternals.
Related Issues (20)
- Shuffle details的一点建议 HOT 2
- 一个问题,就是Spark是不是能把所有传入作为参数的函数都分布式进行计算?对吗? HOT 1
- Narrow dependencies-第二章第二节图FullDependency: N : N HOT 5
- readme.md的content目录,英文版的link不统一 HOT 2
- 第一章配置多个 CoarseGrainedExecutorBackend 进程 HOT 2
- 关于cache()的疑问 HOT 1
- 关于partitioner的疑问
- 关于第三章第二幅图的理解 HOT 4
- 请教个关于spark具体应用设计问题 HOT 3
- Spark 2.0 Content HOT 2
- java.lang.UnsupportedOperationException: Cannot evaluate expression: PythonUDF#Grappra(input[410, StringType])
- reduceByKey 函数 map 端 combine 的实现变化
- 第二章 JobLogicaPlan.pdf 存在笔误
- 请问文章中的图是用什么软件画的?
- 还会继续更新吗?最后的两个章节? HOT 1
- 关于第二章JobLogicalPlan的一点小意见 HOT 1
- Please add README.md to markdown/thai HOT 1
- Why the definition of dependencies is different from RDD paper?
- gitbook无法下载
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparkinternals.