...

Big Data - Apache Pig

Back to Course

Lesson Description


Lession - #465 Apache pig LOAD Operator


The Apache Pig Operators is an high level procedural language for questioning enormous informational collections utilizing Hadoop and the Map-Reduce Platform. A Pig Latin statement is an administrator that takes a connection as information and produces one more connection as result.

The Apache Pig LOAD operator is utilized to load the data from the file system.

Given below is the syntax of the LOAD operator.

Syntax


LOAD 'info' [USING FUNCTION] [AS SCHEMA];  


Here,
  • LOAD is a relational operator.
  • 'info' is a file that is required to load. It contains any sort of information.
  • Using is a keyword.
  • Function is a load work.
  • As is keyword.
  • Schema is a mapping of passing document, encased in parentheses.

    Example

    
    
    grunt> customers = LOAD 'hdfs://localhost:9000/pig_data/customers.txt' USING PigStorage(','>
    as (id:int, name:chararray, age:int, address:chararray, salary:int>
    ;