pig tutorial - apache pig tutorial - Apache Pig Describe Operator - pig latin - apache pig - pig hadoop
What is describe operator?
- The describe operator is used to view the schema of a relation.
- It Returns the schema of a relation.
- Prints the schema of the relation at standard output
Syntax:
- The syntax of the describe operator is as follows −
Usage:
- Use the DESCRIBE operator to view the schema of a relation.
- You can view outer relations as well as relations defined in a nested FOREACH statement.
Example:
- Assume we have a file student_data.txt in HDFS with the following content.
- And read it into a relation student using the LOAD operator as shown below.
- Now, describe the relation named student and verify the schema as shown below.
- Once you execute the above Pig Latin statement, it will produce the following output.