Pig System Analysis (7) Pig Utility class

Source: Internet
Author: User
Tags file system

Explain

Explain is a pig-provided debugging tool that uses explain to output pig lation execution plans. It is worth mentioning that explain supports the-DOT option to output the execution plan in DOT format (dot is a graphical description language, refer to http://zh.wikipedia.org/zh/DOT%E8%AF%AD%E8%A8%80)

Code implementation detailed in Org.apache.pig.impl.plan.DotPlanDumper, this part of the implementation of our design implementation plan visualization provides a reference. The following diagram section intercepts the graphs that were generated after the physical execution plan dot file was opened using Graphviz. (Graphviz Introduction Please refer to Http://zh.wikipedia.org/wiki/Graphviz)

Illustrate

Illustrate is further than explain, it will automatically generate the sample data suitable for execution plan according to the specific statement expression conditions, and simulate execution, and the results of each step are output according to the table to simulate a complete data processing process. Code implementation details see Org.apache.pig.pen.Illustrator.

Pigcontext

The Pigcontext class contains contextual basic information that is required at various stages of the pig execution process, pigcontext from the front end to the back end, all the time until the Hadoop job phase is available. In the Map&reduce initialization method, get the Pigcontext from the Hadoop configuration.

pigcontext= (Pigcontext) objectserializer.deserialize (Job.get ("Pig.pigcontext"));

The more important information in Pigcontext is:

Exectype: Execution type, LOCAL/MR.

Hexecutionengine: Back-end execution engine.

Script files/various jar packs and so on.

Mapping of Definedfunctions:funcname and Funcspec.

Datastorage: File System interface, Dfs&lfs.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/storage/

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.