Pig图解运算符


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

句法

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

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        |
---------------------------------------------------------------------------------------------