Pig illustrate 运算符



  • illustrate 运算符

    illustrate 运算符 给你一步一步的执行语句序列。
    句法
    下面给出了 illustrate 运算符的语法。
    
    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运算符将其读入关系student。
    
    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        |
    ---------------------------------------------------------------------------------------------