当前位置:K88软件开发文章中心大数据Apache Pig → 文章内容

Apache Pig Describe运算符

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-26 10:03:36

由 jarodhu 创建,youj 最后一次修改 2016-12-28 describe 运算符用于查看关系的模式。语法 describe 运算符的语法如下grunt> Describe Relation_name例假设在HDFS中有一个包含以下内容的文件 student_data.txt 。001,Rajiv,Reddy,9848022337,Hyderabad002,siddarth,Battacharya,9848022338,Kolkata003,Rajesh,Khanna,9848022339,Delhi004,Preethi,Agarwal,9848022330,Pune005,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> describe student;输出执行上述 Pig Latin 语句后,将生成以下输出。grunt> student: { id: int,firstname: chararray,lastname: chararray,phone: chararray,city: chararray }

Apache Pig Describe运算符