Access over 35 million academic & study documents

A)Please create example datasets with using Pig Complex Data Types (

Content type
User Generated
Rating
Showing Page:
1/5
a)Please create example datasets with using Pig Complex
Data Types (Tuple, Bag, Map)
b)Write LOAD statements for this datasets
Solution
Convention Description Example
UPPERCASE
lowercase
In general, uppercase type indicates elements the system
supplies.
In general, lowercase type indicates elements that you
supply.
Pig Latin statement:
a = LOAD \'data\' AS (f1:int);
LOAD, AS - Pig keywords
a, f1 - aliases you supply
\'data\' - data source you
EXAMPLES
Pig programs can be run in three methods which work in
both local and MapReduce mode. They are

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/5
Let see each mode in detail
Script Mode or Batch Mode: In script mode, pig runs the
commands specified in a script file. The following example
shows how to run a pig programs from a script file:
Grunt Mode or Interactive Mode: The grunt mode can also
be called as interactive mode. Grunt is pig\'s interactive
shell. It is started when no file is specified for pig to run.
You can also run pig scripts from grunt using run and exec
commands.
LOAD operator
The LOAD operator is used to define a schema for a data
set. Let see different usages of the LOAD operator for
defining the schema for the above dataset.
1. Creating Schema without specifying any fields.
In this method, we don\'t specify any field names for
creating the schema. An example is shown below:
We can create a schema just by specifying the field names
without any data types. An example is shown below:
Convention Description Example

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/5

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 5 pages?
Access Now
Unformatted Attachment Preview
a)Please create example datasets with using Pig Complex Data Types (Tuple, Bag, Map) b)Write LOAD statements for this datasets Solution Convention Description Example UPPERCASE lowercase In general, uppercase type indicates elements the system supplies. In general, lowercase type indicates elements that you supply. Pig Latin statement: a = LOAD \'data\' AS (f1:int); LOAD, AS - Pig keywords a, f1 - aliases you supply \'data\' - data source you EXAMPLES Pig programs can be run in three met hods which work in both local and MapReduce mode. They are Let see each mode in detail Script Mode or Batch Mode: In script mode, pig runs the commands specified in a script file. The following example shows how to run a pig programs from a script file: Grunt Mode or Interactive Mode: The grunt mode can also be called as interactive mode. Grunt is pig \'s interactive shell. It is started when no file is specified for pig to run. You can also run pig scripts from grunt using run and exec commands. LOAD operator The LOAD operator is used to define a schema for a data set. Let see different usages of the LOAD operator for defining the schema for the above dataset. 1. Creating Schema without specifying any fields. In this method, we don\'t specify any field names for creating the schema. An example is shown below: We can create a schema just by specifying the field names without any data types. An example is shown below: Convention Description Example UPPERCASE lowercase In genera ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Great study resource, helped me a lot.

Studypool
4.7
Indeed
4.5
Sitejabber
4.4

Similar Documents