课程表

Apache Pig 基础

Apache Pig 诊断运算符

Apache Pig 分组和连接

Apache Pig 合并和拆分

Apache Pig 过滤

Apache Pig 排序

Pig Latin 内置函数

Apache Pig 其他执行模式

工具箱
速查手册

Describe运算符

当前位置:免费教程 » 大数据/云 » Apache Pig

describe 运算符用于查看关系的模式。

语法

describe 运算符的语法如下

  1. grunt> Describe Relation_name

假设在HDFS中有一个包含以下内容的文件 student_data.txt

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

使用LOAD运算符将它读入关系 student ,如下所示。

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

现在,让我们描述名为student的关系,并验证模式如下所示。

  1. grunt> describe student;

输出

执行上述 Pig Latin 语句后,将生成以下输出。

  1. grunt> student: { id: int,firstname: chararray,lastname: chararray,phone: chararray,city: chararray }
转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号