当前位置:网站首页>Aggregate function with key in spark
Aggregate function with key in spark
2022-07-06 21:43:00 【Big data Xiaochen】
RDD Every element of is 【 Key value pair 】 To call the following functions .
groupByKey
aggregateByKey
rdd = sc.parallelize([('a', 1), ('b', 1), ('a', 1), ('b', 1), ('a', 1)], 2)
When aggregating in the following partition , The initial value will participate in the calculation , When aggregating between partitions , The initial value will not participate in the calculation .

foldByKey
foldByKey By aggregateByKey Simplify
When aggregateByKey The logic of aggregation functions within and between partitions of is the same , It can be omitted as a , It becomes foldByKey.
reduceByKey
reduceByKey By foldByKey Simplify
When foldByKey When the initial value of is meaningless , You can omit it
边栏推荐
- This year, Jianzhi Tencent
- 3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
- C language char, wchar_ t, char16_ t, char32_ Relationship between T and character set
- What about the spectrogram
- 首批入选!腾讯安全天御风控获信通院业务安全能力认证
- 50个常用的Numpy函数解释,参数和使用示例
- [redis design and implementation] part I: summary of redis data structure and objects
- Redistemplate common collection instructions opsforset (V)
- 语谱图怎么看
- SDL2来源分析7:演出(SDL_RenderPresent())
猜你喜欢

PostgreSQL modifies the password of the database user

JS method to stop foreach

Seven original sins of embedded development

Summary of cross partition scheme
![[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics](/img/2d/9a7e88fb774984d061538e3ad4a96b.png)
[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics

Why do job hopping take more than promotion?

袁小林:安全不只是标准,更是沃尔沃不变的信仰和追求
![[redis design and implementation] part I: summary of redis data structure and objects](/img/2e/b147aa1e23757519a5d049c88113fe.png)
[redis design and implementation] part I: summary of redis data structure and objects
![Leetcode topic [array] -118 Yang Hui triangle](/img/77/d8a7085968cc443260b4c0910bd04b.jpg)
Leetcode topic [array] -118 Yang Hui triangle

Fastjson parses JSON strings (deserialized to list, map)
随机推荐
在Pi和Jetson nano上运行深度网络,程序被Killed
OneNote in-depth evaluation: using resources, plug-ins, templates
Redistemplate common collection instructions opsforzset (VI)
技术分享 | 抓包分析 TCP 协议
High precision face recognition based on insightface, which can directly benchmark hongruan
【力扣刷题】一维动态规划记录(53零钱兑换、300最长递增子序列、53最大子数组和)
The relationship between root and coefficient of quadratic equation with one variable
跨分片方案 总结
jvm:大对象在老年代的分配
guava:Collections.unmodifiableXXX创建的collection并不immutable
Four common ways and performance comparison of ArrayList de duplication (jmh performance analysis)
Microsoft technology empowerment position - February course Preview
JS get array subscript through array content
对话阿里巴巴副总裁贾扬清:追求大模型,并不是一件坏事
Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"
Seven original sins of embedded development
After working for 5 years, this experience is left when you reach P7. You have helped your friends get 10 offers
string的底层实现
1292_FreeROS中vTaskResume()以及xTaskResumeFromISR()的实现分析
Guava: three ways to create immutablexxx objects