<s>
is	O
a	O
high-level	O
platform	O
for	O
creating	O
programs	O
that	O
run	O
on	O
Apache	B-Application
Hadoop	I-Application
.	O
</s>
<s>
The	O
language	O
for	O
this	O
platform	O
is	O
called	O
Pig	B-Language
Latin	I-Language
.	O
</s>
<s>
Pig	B-Language
can	O
execute	O
its	O
Hadoop	B-Application
jobs	O
in	O
MapReduce	B-Operating_System
,	O
Apache	O
Tez	O
,	O
or	O
Apache	B-Language
Spark	I-Language
.	O
</s>
<s>
Pig	B-Language
Latin	I-Language
abstracts	O
the	O
programming	O
from	O
the	O
Java	B-Language
MapReduce	B-Operating_System
idiom	O
into	O
a	O
notation	O
which	O
makes	O
MapReduce	B-Operating_System
programming	O
high	O
level	O
,	O
similar	O
to	O
that	O
of	O
SQL	B-Language
for	O
relational	B-Application
database	I-Application
management	I-Application
systems	I-Application
.	O
</s>
<s>
Pig	B-Language
Latin	I-Language
can	O
be	O
extended	O
using	O
user-defined	B-Language
functions	I-Language
(	O
UDFs	O
)	O
which	O
the	O
user	O
can	O
write	O
in	O
Java	B-Language
,	O
Python	B-Language
,	O
JavaScript	B-Language
,	O
Ruby	B-Language
or	O
Groovy	B-Application
and	O
then	O
call	O
directly	O
from	O
the	O
language	O
.	O
</s>
<s>
Apache	B-Language
Pig	I-Language
was	O
originally	O
developed	O
at	O
Yahoo	B-Application
Research	I-Application
around	O
2006	O
for	O
researchers	O
to	O
have	O
an	O
ad	O
hoc	O
way	O
of	O
creating	O
and	O
executing	O
MapReduce	B-Operating_System
jobs	O
on	O
very	O
large	O
data	O
sets	O
.	O
</s>
<s>
Regarding	O
the	O
naming	O
of	O
the	O
Pig	B-Language
programming	O
language	O
,	O
the	O
name	O
was	O
chosen	O
arbitrarily	O
and	O
stuck	O
because	O
it	O
was	O
memorable	O
,	O
easy	O
to	O
spell	O
,	O
and	O
for	O
novelty	O
.	O
</s>
<s>
Below	O
is	O
an	O
example	O
of	O
a	O
"	O
Word	O
Count	O
"	O
program	O
in	O
Pig	B-Language
Latin	I-Language
:	O
</s>
<s>
The	O
above	O
program	O
will	O
generate	O
parallel	O
executable	O
tasks	O
which	O
can	O
be	O
distributed	O
across	O
multiple	O
machines	O
in	O
a	O
Hadoop	B-Application
cluster	O
to	O
count	O
the	O
number	O
of	O
words	O
in	O
a	O
dataset	O
such	O
as	O
all	O
the	O
webpages	O
on	O
the	O
internet	O
.	O
</s>
<s>
is	O
able	O
to	O
store	O
data	O
at	O
any	O
point	O
during	O
a	O
pipeline	B-Operating_System
,	O
</s>
<s>
declares	O
execution	B-Language
plans	I-Language
,	O
</s>
<s>
supports	O
pipeline	B-Operating_System
splits	O
,	O
thus	O
allowing	O
workflows	O
to	O
proceed	O
along	O
DAGs	O
instead	O
of	O
strictly	O
sequential	O
pipelines	B-Operating_System
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
it	O
has	O
been	O
argued	O
DBMSs	O
are	O
substantially	O
faster	O
than	O
the	O
MapReduce	B-Operating_System
system	O
once	O
the	O
data	O
is	O
loaded	O
,	O
but	O
that	O
loading	O
the	O
data	O
takes	O
considerably	O
longer	O
in	O
the	O
database	O
systems	O
.	O
</s>
<s>
Pig	B-Language
Latin	I-Language
is	O
procedural	B-Application
and	O
fits	O
very	O
naturally	O
in	O
the	O
pipeline	B-Operating_System
paradigm	O
while	O
SQL	B-Language
is	O
instead	O
declarative	B-Language
.	O
</s>
<s>
In	O
SQL	B-Language
users	O
can	O
specify	O
that	O
data	O
from	O
two	O
tables	O
must	O
be	O
joined	O
,	O
but	O
not	O
what	O
join	O
implementation	O
to	O
use	O
(	O
You	O
can	O
specify	O
the	O
implementation	O
of	O
JOIN	O
in	O
SQL	B-Language
,	O
thus	O
"	O
...	O
for	O
many	O
SQL	B-Language
applications	O
the	O
query	O
writer	O
may	O
not	O
have	O
enough	O
knowledge	O
of	O
the	O
data	O
or	O
enough	O
expertise	O
to	O
specify	O
an	O
appropriate	O
join	O
algorithm.	O
"	O
)	O
.	O
</s>
<s>
Pig	B-Language
Latin	I-Language
allows	O
users	O
to	O
specify	O
an	O
implementation	O
or	O
aspects	O
of	O
an	O
implementation	O
to	O
be	O
used	O
in	O
executing	O
a	O
script	O
in	O
several	O
ways	O
.	O
</s>
<s>
In	O
effect	O
,	O
Pig	B-Language
Latin	I-Language
programming	O
is	O
similar	O
to	O
specifying	O
a	O
query	B-Language
execution	I-Language
plan	I-Language
,	O
making	O
it	O
easier	O
for	O
programmers	O
to	O
explicitly	O
control	O
the	O
flow	O
of	O
their	O
data	O
processing	O
task	O
.	O
</s>
<s>
SQL	B-Language
is	O
oriented	O
around	O
queries	O
that	O
produce	O
a	O
single	O
result	O
.	O
</s>
<s>
SQL	B-Language
handles	O
trees	O
naturally	O
,	O
but	O
has	O
no	O
built	O
in	O
mechanism	O
for	O
splitting	O
a	O
data	O
processing	O
stream	O
and	O
applying	O
different	O
operators	O
to	O
each	O
sub-stream	O
.	O
</s>
<s>
Pig	B-Language
Latin	I-Language
script	O
describes	O
a	O
directed	O
acyclic	O
graph	O
(	O
DAG	O
)	O
rather	O
than	O
a	O
pipeline	B-Operating_System
.	O
</s>
<s>
Pig	B-Language
Latin	I-Language
's	O
ability	O
to	O
include	O
user	O
code	O
at	O
any	O
point	O
in	O
the	O
pipeline	B-Operating_System
is	O
useful	O
for	O
pipeline	B-Operating_System
development	O
.	O
</s>
<s>
If	O
SQL	B-Language
is	O
used	O
,	O
data	O
must	O
first	O
be	O
imported	O
into	O
the	O
database	O
,	O
and	O
then	O
the	O
cleansing	O
and	O
transformation	O
process	O
can	O
begin	O
.	O
</s>
