开发手册 欢迎您!
软件开发者资料库

Apache Pig - 说明操作员

Apache Pig Illustrate操作员 - 从概述,体系结构,安装,执行,Grunt Shell,Pig Latin Basics,读取数据,存储数据,诊断操作员,描述操作员,解释操作员,Illustrate操作员,组操作员,Cogroup操作员,加入,学习Apache Pig操作员,跨操作员,联合操作员,拆分操作员,过滤操作员,不同操作员,Foreach操作员,订单依据,限制操作员,评估函数,加载和存储函数,包和元组函数,字符串函数,日期时间函数,数学函数,用户定义的函数,运行脚本。

说明运算符为您提供了一系列语句的逐步执行.

语法

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

grunt> illustrate Relation_name;

示例

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

001,Rajiv,Reddy,9848022337,Hyderabad002,siddarth,Battacharya,9848022338,Kolkata 003,Rajesh,Khanna,9848022339,Delhi004,Preethi,Agarwal,9848022330,Pune 005,Trupthi,Mohanthy,9848022336,Bhuwaneshwar006,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 - Aliasesbeing 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        |---------------------------------------------------------------------------------------------