OReilly.Learning.Spark.2015.1-CN-13-Chapter4.pdf

  1. 1、本文档共42页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
OReilly.Learning.Spark.2015.1-CN-13-Chapter4.pdf

Learning Spark LIGHTNING-FAST DATAANALYSIS Holden Karau, Andy Konwinski, PatrickWendellMateiZaharia CHAPTER 4 Working with Key/Value Pairs This chapter covers how to work with RDDs of key/value pairs, which are a common data type required for many operations in Spark. Key/value RDDs are commonly used to perform aggregations, and often we will do some initial ETL (extract, trans‐ form, and load) to get our data into a key/value format. Key/value RDDs expose new operations (e.g., counting up reviews for each product, grouping together data with the same key, and grouping together two different RDDs). 本章介绍了如何使用key/value RDD,这是Spark 最常见的数据类型。key/valueRDD 常用于进行数据聚合,而且往往我们会做一些初步的ETL (提取,传输,加载), 以把我们的数据转成key/value 格式。key/value RDD 提供更多操作(例如,统计每 个产品的评论数,统计相同键的数据,把两个不同的RDD 组合在一起)。 We also discuss an advanced feature that lets users control the layout of pair RDDs across nodes: partitioning. Using controllable partitioning, applications can some‐ times greatly reduce communication costs by ensuring that data will be accessed together and will be on the same node. This can provide significant speedups. We illustrate partitioning using the PageRank algorithm as an example. Choosing the right partitioning for a distributed dataset is similar to choosing the right data struc‐ ture for a local one—in both cases, data layout can greatly affect performance. 我们会进一步讨论让用户控制各节点之间RDD 的布局,即分区策略。使用可控的分 区,把常常同时访问的数据放在同一节点,将大大降低通信费用,提升访问速率。 我们将以PageRank 算法为例介绍分区策略。为分布式数据集选择正确的分区策略的 重要性类似于为本地数据选择正确的数据结构。在这两种环境下,分区策略和数据 结构都会极大地影响系统性能。 Motivation Spark provides special operations on RDDs containing key/value pairs. These RDDs are called pair RDDs. Pair RDDs are a useful building block in many programs, as 50 | Chapte

文档评论(0)

feiyang66 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档