当前位置:网站首页>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
边栏推荐
- [Li Kou brush questions] 32 Longest valid bracket
- Efficiency tool +wps check box shows the solution to the sun problem
- PostgreSQL modifies the password of the database user
- Quick access to video links at station B
- Microsoft technology empowerment position - February course Preview
- 通过数字电视通过宽带网络取代互联网电视机顶盒应用
- Vit paper details
- [redis design and implementation] part I: summary of redis data structure and objects
- Guava: three ways to create immutablexxx objects
- The underlying implementation of string
猜你喜欢
Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
JPEG2000 matlab source code implementation
Digital transformation takes the lead to resume production and work, and online and offline full integration rebuilds business logic
039. (2.8) thoughts in the ward
Absolute primes (C language)
OneNote in-depth evaluation: using resources, plug-ins, templates
Seven original sins of embedded development
uni-app App端半屏连续扫码
ViT论文详解
随机推荐
[Digital IC manual tearing code] Verilog automatic beverage machine | topic | principle | design | simulation
Sdl2 source analysis 7: performance (sdl_renderpresent())
Microsoft technology empowerment position - February course Preview
技术分享 | 抓包分析 TCP 协议
C language char, wchar_ t, char16_ t, char32_ Relationship between T and character set
Is this the feeling of being spoiled by bytes?
分糖果
document. Usage of write () - write text - modify style and position control
[Li Kou brushing questions] one dimensional dynamic planning record (53 change exchanges, 300 longest increasing subsequence, 53 largest subarray and)
14年本科毕业,转行软件测试,薪资13.5K
The difference between break and continue in the for loop -- break completely end the loop & continue terminate this loop
WEB功能测试说明
Redistemplate common collection instructions opsforzset (VI)
Guava: use of multiset
Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
ROS error: could not find a package configuration file provided by "move_base“
El table table - get the row and column you click & the sort of El table and sort change, El table column and sort method & clear sort clearsort
uni-app App端半屏连续扫码
跨分片方案 总结
The underlying implementation of string