Docsity

Pig - Clouds and Power-Aware Computing - Lecture Slides, Slides of Computer-Aided Power System Analysis

Partial preview of the text

Download Pig - Clouds and Power-Aware Computing - Lecture Slides and more Slides Computer-Aided Power System Analysis in PDF only on Docsity!

In Java/Python In Pig+Java Today, we'll start with Pig Two kinds of Map/Reduce programming Programming Map/Reduce Docsity.com

We have class tomorrow (Monday's schedule)!

A Map phase in which we do something to each record. A Reduce phase where we combine results. Map/Reduce consists of The Map/Reduce framework does the rest. We only write what to do to each element, and how to combine a list of things. Recall from last time Recall from last time Docsity.com

Filter: map selects, reduce combines. Sort: map selects, reduce merge-sorts. Construct: map creates new data, reduce reports what was done. Common Map/Reduce algorithms Common Map/Reduce algorithms Docsity.com

No choice on reducer (combine and eliminate duplicates). Very limited map capabilities. You might have noticed that there are severe limits on what you can do with MapReduce directly inside AppEngine: If you write a mapper, it has to be propogated to each map node. This is moving code, not data. This is relatively expensive and somewhat dangerous. Otherwise, you cannot inject code into the cloud. This has security and other implications. Why? Understanding limits of AppEngine MapReduce Docsity.com

Map and Reduce are pre-coded. There is no need to propogate code. Google MR is fast because Must propogate jarfile for Map, Combine, Reduce classes to each Hadoop node. Up to 30 seconds for a large array. So, basically no one uses it for real time queries. Hadoop MR has a very slow startup time because Myths and Realities of MR Myths and Realities of MR Docsity.com

Often, can compute and pre-store results of commonly needed queries. These run much faster on Hadoop than serially. Then we query the results normally. So, what is Hadoop MR good for? So, what is Hadoop MR good for? Docsity.com

A data restructuring subsystem of Hadoop Input is a database. Output is a table. SQL is intended for queries. Input is a set of distributed files. Output is another distributed file. Pig Latin is intended for restructuring data. With its own language Pig Latin with SQL-like syntax. But Pig Pig Docsity.com