in this video we are discussing pig
latin basics so let us go for more
discussion on it so how to write code in
pig latin so who have made one list of
different rules do's and don'ts so that
you can feel better to writing codes in
pig latin the first one is that we will
use the grand cell to write pig latin
codes in the grand shell we need to
follow some rules to write pig latin
codes so we are supposed to go through
some rules right now so pig latin syntax
will work with relations and they
include expressions and also schema so
they can use different kinds of
expressions and schema in our pig latin
syntax so we can use different operators
of pig latin to complete our task and
this list of operators and operations
will be discussing next and except for
the load and store operation the pig
latin takes a deletion as input and
returns another the relation as output
so only in case of load and store these
two command executions it will take the
deletion one in as input and it produces
or it outputs relations as output so
until the dump operator is not used any
MapReduce tasks will be executed so i
dq8 the dump operator to get executed
next one is that we should use the
semicolon after each line of code in pig
so the semicolon giving is mandatory at
the each and every line of the pig
statements now datatypes in pig latin so
what are the different data types and
the respective sizes we'll be discussing
here so given below the table describes
some of the pig latin
datatypes so here we are having this int
and it is signed 32-bit integer we're
having long signed 64-bit integer we're
having float sign 32-bit floating-point
number that the double that is assigned
64-bit floating-point number that means
it is occupying 4 bytes it is occupying
8 bytes in the memory card add a
character array or string we're having
the date/time represents date and
when having boolean boolean value will
be true or false as is well we're having
the byte array that is a byte array so
in this way we are having multiple
different data types are there and the
respective descriptions we have provided
complex data types in pig latin so the
given below the table describes some of
the complex pig latin
datatypes the first one is a tuple a
tuple that means a order set of fields
so fields will be containing values
ordered set of fields will be known one
as a tuple back a bag means a collection
of tuples we're having this map map
means a set of key value pairs next
relational operations in pig latin so we
were discussing that what are the
relational operations so these are the
relational operations are there so the
following table describes the relational
operators on pig latin the first one is
the load so load data from HDFS or local
disk where having the store save data to
SD FS all on to the local disk we're
having the filter remove unwanted rows
distinct remove duplicate rows we're
having for each comma generate in that
case to generate data transformations
based on the columns of data so that for
that we'll be using for each and gene
generate we're having the stream
transforms relations with external
program so that is a stream we're having
the dump putting data for relation so
dump is one of the respective operators
so now let us go for relational
operators in pig latin we are going for
the joined to join two or more relations
we're having Co group so group the data
in two or more relations so that is of a
co group we're having the operator that
is of a group to group the data in a
single relation and then we're having
cross there is a cross product between
the tables we're having ordered an
engine relation in the shorted order
were having the limit to get the limited
number of tuples not all the tuples were
going to get the limited number of
tuples Union combines multiple relations
into one and then we're having the
spirit sweet one relation to multiple
relations so Union we are having that is
to get to combine multiple relations to
one but here in case of spirit one
relation to multiple relations we're
having the describe that is a describe
the schema of a relation so these are
the different relational operators which
will be available in about Pig Latin and
in this way we are concluding the pig
latin basics in this video thanks for
watching this video