Apache Pig – Illustrate Operator

Apache Pig – Illustrate Operator


演示操作给你一步一步的执行语句序列。

句法

下面给出了说明运算符的语法

grunt> illustrate Relation_name;

例子

假设我们在 HDFS 中有一个文件student_data.txt,其内容如下。

001,Rajiv,Reddy,9848022337,Hyderabad
002,siddarth,Battacharya,9848022338,Kolkata 
003,Rajesh,Khanna,9848022339,Delhi
004,Preethi,Agarwal,9848022330,Pune 
005,Trupthi,Mohanthy,9848022336,Bhuwaneshwar
006,Archana,Mishra,9848022335,Chennai.

我们已经使用 LOAD 运算符将其读入关系学生中,如下所示。

grunt> student = LOAD 'hdfs://localhost:9000/pig_data/student_data.txt' USING PigStorage(',')
   as ( id:int, firstname:chararray, lastname:chararray, phone:chararray, city:chararray );

现在,让我们说明名为 student 的关系,如下所示。

grunt> illustrate student;

输出

执行上述语句后,您将获得以下输出。

grunt> illustrate student;

INFO  org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapOnly$M ap - Aliases
being processed per job phase (AliasName[line,offset]): M: student[1,10] C:  R:
---------------------------------------------------------------------------------------------
|student | id:int | firstname:chararray | lastname:chararray | phone:chararray | city:chararray |
--------------------------------------------------------------------------------------------- 
|        | 002    | siddarth            | Battacharya        | 9848022338      | Kolkata        |
---------------------------------------------------------------------------------------------

觉得文章有用?

点个广告表达一下你的爱意吧 !😁