Home » Analytics » Comparing PIG with Hive SQL

Comparing PIG with Hive SQL

Software

R in the Cloud

Train in R

In PIG

a = LOAD 'nyse' USING org.apache.hcatalog.pig.HCatLoader();
b = FILTER a BY stock_symbol =='IBM' ;
c = group b all;
d = foreach c generate AVG(b.stock_volume);
dump d;

In SQL (Hive)

select AVG(stock_volume) from nyse where stock_symbol =="IBM"

(from HDP 2.0 Horton Sandbox Example)

Also see

http://www.quora.com/How-can-R-and-Hadoop-be-used-together

 


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Conferences

Predictive Analytics- The Book

Books

Follow

Get every new post delivered to your Inbox.

Join 840 other followers