The--pig framework for Hadoop

Source: Internet
Author: User

Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46491773
1.Pig is a data processing framework based on Hadoop. MapReduce is developed using Java, and Pig has its own data processing language, and the pig's processing process is converted to Mr to run.
The data processing language of 2.Pig is the way of traffic, similar to the maths problem in junior middle school. 3.Pig basic Data type: int, long, float, double, chararry, ByteArray composite data type: MAP, Tuple, Bag
The type of bag such as {(' age ', +), (' name ', ' Zhang San ')}
4. How to install Pig4.1 copy pig-0.11.1.tar.gz to/usr/local 4.2 use command tar-zxvf pig-0.11.1.tar.gz extract 4.3 use command mv pig-0.11.1 Pig for renaming 4.4 series File vi/etc/profile setting environment variables export $PIG _home=/usr/local/bin
Export PATH = ... $PIG _home/bin ....
Save, and then execute Source/etc/profile
4.5 Edit File $pig_home/conf/pig.properties

Add two lines to the following:

fs.default.name=hdfs://hadoop0:9000
mapred.job.tracker=hadoop0:9001
5. How WLAN data is analyzed using Pig 5.1 upload pending data to HDFs 5.2 convert the data in HDFs to the pattern that pig can process a = LOAD '/wlan ' as (T0:long, Msisdn:chararray, T2: Chararray, T3:chararray, T4:chararray, T5:chararray, T6:long, T7:long, T8:long, T9:long, T10:chararray);
5.3 Extract the useful fields from the inside B = FOREACH A GENERATE msisdn, T6, T7, T8, T9;
5.4 Packet Data C = group B by MSISDN;
5.5 Traffic Summary D = FOREACH C GENERATE Group, sum (B.T6), sum (B.T7), sum (B.T8), sum (B.T9);
5.6 Stored in HDFs store D into '/wlan_result ';

The--pig framework for Hadoop

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.