You are previewing MapReduce Design Patterns.

MapReduce Design Patterns

Cover of MapReduce Design Patterns by Donald Miner... Published by O'Reilly Media, Inc.
  1. MapReduce Design Patterns
  2. Dedication
  3. Preface
    1. Intended Audience
    2. Pattern Format
    3. The Examples in This Book
    4. Conventions Used in This Book
    5. Using Code Examples
    6. Safari® Books Online
    7. How to Contact Us
    8. Acknowldgements
  4. 1. Design Patterns and MapReduce
    1. Design Patterns
    2. MapReduce History
    3. MapReduce and Hadoop Refresher
    4. Hadoop Example: Word Count
    5. Pig and Hive
  5. 2. Summarization Patterns
    1. Numerical Summarizations
      1. Pattern Description
      2. Numerical Summarization Examples
    2. Inverted Index Summarizations
      1. Pattern Description
      2. Inverted Index Example
    3. Counting with Counters
      1. Pattern Description
      2. Counting with Counters Example
  6. 3. Filtering Patterns
    1. Filtering
      1. Pattern Description
      2. Filtering Examples
    2. Bloom Filtering
      1. Pattern Description
      2. Bloom Filtering Examples
    3. Top Ten
      1. Pattern Description
      2. Top Ten Examples
    4. Distinct
      1. Pattern Description
      2. Distinct Examples
  7. 4. Data Organization Patterns
    1. Structured to Hierarchical
      1. Pattern Description
      2. Structured to Hierarchical Examples
    2. Partitioning
      1. Pattern Description
      2. Partitioning Examples
    3. Binning
      1. Pattern Description
      2. Binning Examples
    4. Total Order Sorting
      1. Pattern Description
      2. Total Order Sorting Examples
    5. Shuffling
      1. Pattern Description
      2. Shuffle Examples
  8. 5. Join Patterns
    1. A Refresher on Joins
    2. Reduce Side Join
      1. Pattern Description
      2. Reduce Side Join Example
      3. Reduce Side Join with Bloom Filter
    3. Replicated Join
      1. Pattern Description
      2. Replicated Join Examples
    4. Composite Join
      1. Pattern Description
      2. Composite Join Examples
    5. Cartesian Product
      1. Pattern Description
      2. Cartesian Product Examples
  9. 6. Metapatterns
    1. Job Chaining
      1. With the Driver
      2. Job Chaining Examples
      3. With Shell Scripting
      4. With JobControl
    2. Chain Folding
      1. The ChainMapper and ChainReducer Approach
      2. Chain Folding Example
    3. Job Merging
      1. Job Merging Examples
  10. 7. Input and Output Patterns
    1. Customizing Input and Output in Hadoop
      1. InputFormat
      2. RecordReader
      3. OutputFormat
      4. RecordWriter
    2. Generating Data
      1. Pattern Description
      2. Generating Data Examples
    3. External Source Output
      1. Pattern Description
      2. External Source Output Example
    4. External Source Input
      1. Pattern Description
      2. External Source Input Example
    5. Partition Pruning
      1. Pattern Description
      2. Partition Pruning Examples
  11. 8. Final Thoughts and the Future of Design Patterns
    1. Trends in the Nature of Data
      1. Images, Audio, and Video
      2. Streaming Data
    2. The Effects of YARN
    3. Patterns as a Library or Component
    4. How You Can Help
  12. A. Bloom Filters
    1. Overview
    2. Use Cases
      1. Representing a Data Set
      2. Reduce Queries to External Database
      3. Google BigTable
    3. Downsides
    4. Tweaking Your Bloom Filter
  13. Index
  14. About the Authors
  15. Colophon
  16. Copyright

Chapter 3. Filtering Patterns

The patterns in this chapter all have one thing in common: they don’t change the actual records. These patterns all find a subset of data, whether it be small, like a top-ten listing, or large, like the results of a deduplication. This differentiates filtering patterns from those in the previous chapter, which was all about summarizing and grouping data by similar fields to get a top-level view of the data. Filtering is more about understanding a smaller piece of your data, such as all records generated from a particular user, or the top ten most used verbs in a corpus of text. In short, filtering allows you to apply a microscope to your data. It can also be considered a form of search. If you are interested in finding all records that involve a particular piece of distinguishing information, you can filter out records that do not match the search criteria.

Sampling, one common application of filtering, is about pulling out a sample of the data, such as the highest values for a particular field or a few random records. Sampling can be used to get a smaller, yet representative, data set in which more analysis can be done without having to deal with the much larger data set. Many machine learning algorithms simply do not work efficiently over a large data set, so tools that build models need to be applied to a smaller subset.

A subsample can also be useful for development purposes. Simply grabbing the first thousand records typically is not the best sample ...

The best content for your career. Discover unlimited learning on demand for around $1/day.