<s>
The	O
parallelization	B-Operating_System
contract	I-Operating_System
or	O
PACT	O
programming	O
model	O
is	O
a	O
generalization	O
of	O
the	O
MapReduce	B-Operating_System
programming	O
model	O
and	O
uses	O
second	B-Language
order	I-Language
functions	I-Language
to	O
perform	O
concurrent	O
computations	O
on	O
large	O
(	O
Petabytes	O
)	O
data	O
sets	O
in	O
parallel	O
.	O
</s>
<s>
Similar	O
to	O
MapReduce	B-Operating_System
,	O
arbitrary	O
user	O
code	O
is	O
handed	O
and	O
executed	O
by	O
PACTs	O
.	O
</s>
<s>
However	O
,	O
PACT	O
generalizes	O
a	O
couple	O
of	O
MapReduce	B-Operating_System
's	O
concepts	O
:	O
</s>
<s>
Second-order	B-Language
Functions	I-Language
:	O
PACT	O
provides	O
more	O
second-order	B-Language
functions	I-Language
.	O
</s>
<s>
Currently	O
,	O
five	O
second-order	B-Language
functions	I-Language
called	O
Input	O
Contracts	O
are	O
supported	O
.	O
</s>
<s>
In	O
contract	O
,	O
MapReduce	B-Operating_System
programs	O
have	O
a	O
static	O
structure	O
(	O
Map	O
->	O
Reduce	O
)	O
.	O
</s>
<s>
MapReduce	B-Operating_System
's	O
KeyValue-Pairs	O
can	O
be	O
considered	O
as	O
records	O
with	O
two	O
fields	O
.	O
</s>
<s>
Apache	B-Application
Flink	I-Application
,	O
an	O
open-source	O
parallel	O
data	O
processing	O
platform	O
has	O
implemented	O
PACTs	O
.	O
</s>
<s>
Parallelization	B-Operating_System
Contracts	I-Operating_System
(	O
PACTs	O
)	O
are	O
data	O
processing	O
operators	O
in	O
a	O
data	O
flow	O
.	O
</s>
<s>
More	O
formally	O
,	O
Input	O
Contracts	O
are	O
second-order	B-Language
functions	I-Language
with	O
a	O
first-order	B-Language
function	I-Language
(	O
the	O
user	O
code	O
)	O
,	O
one	O
or	O
more	O
input	O
sets	O
,	O
and	O
none	O
or	O
more	O
key	O
fields	O
per	O
input	O
as	O
parameters	O
.	O
</s>
<s>
The	O
first-order	B-Language
function	I-Language
is	O
called	O
(	O
one	O
or	O
)	O
multiple	O
times	O
with	O
subsets	O
of	O
the	O
input	O
set(s )	O
.	O
</s>
<s>
Since	O
the	O
first-order	B-Language
functions	I-Language
have	O
no	O
side	O
effects	O
,	O
each	O
call	O
is	O
independent	O
from	O
each	O
other	O
and	O
all	O
calls	O
can	O
be	O
done	O
in	O
parallel	O
.	O
</s>
<s>
The	O
second-order	B-Language
functions	I-Language
map( )	O
and	O
reduce( )	O
of	O
the	O
MapReduce	B-Operating_System
programming	O
model	O
are	O
Input	O
Contracts	O
in	O
the	O
context	O
of	O
the	O
PACT	O
programming	O
model	O
.	O
</s>
<s>
The	O
Map	O
Input	O
Contract	O
works	O
in	O
the	O
same	O
way	O
as	O
in	O
MapReduce	B-Operating_System
.	O
</s>
<s>
The	O
Reduce	O
Input	O
Contract	O
has	O
the	O
same	O
semantics	O
as	O
the	O
reduce	O
function	O
in	O
MapReduce	B-Operating_System
.	O
</s>
<s>
In	O
contrast	O
to	O
MapReduce	B-Operating_System
,	O
PACT	O
uses	O
a	O
more	O
generic	O
data	O
model	O
of	O
records	O
(	O
Pact	O
Record	O
)	O
to	O
pass	O
data	O
between	O
functions	O
.	O
</s>
<s>
A	O
Key/Value	O
pair	O
(	O
as	O
in	O
MapReduce	B-Operating_System
)	O
is	O
a	O
special	O
case	O
of	O
that	O
record	O
with	O
only	O
two	O
fields	O
(	O
the	O
key	O
and	O
the	O
value	O
)	O
.	O
</s>
<s>
In	O
case	O
of	O
binary	O
second-order	B-Language
functions	I-Language
such	O
as	O
Cross	O
,	O
Match	O
,	O
and	O
CoGroup	O
,	O
the	O
user	O
can	O
specify	O
one	O
annotation	O
per	O
input	O
.	O
</s>
<s>
Again	O
,	O
for	O
binary	O
second-order	B-Language
functions	I-Language
(	O
Cross	O
,	O
Match	O
,	O
CoGroup	O
)	O
,	O
one	O
annotation	O
per	O
input	O
can	O
be	O
defined	O
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
MapReduce	B-Operating_System
programming	O
model	O
,	O
a	O
PACT	O
program	O
can	O
be	O
arbitrary	O
complex	O
and	O
has	O
no	O
fixed	O
structure	O
.	O
</s>
<s>
Hence	O
,	O
interweaving	O
of	O
functionality	O
which	O
is	O
common	O
for	O
MapReduce	B-Operating_System
jobs	O
can	O
be	O
avoided	O
.	O
</s>
<s>
In	O
MapReduce	B-Operating_System
such	O
often	O
needed	O
functionality	O
must	O
be	O
provided	O
by	O
the	O
developer	O
of	O
the	O
user	O
code	O
.	O
</s>
<s>
In	O
contrast	O
,	O
Hadoop	O
executes	O
MapReduce	B-Operating_System
jobs	O
always	O
with	O
the	O
same	O
strategy	O
.	O
</s>
<s>
For	O
a	O
more	O
detailed	O
comparison	O
of	O
the	O
MapReduce	B-Operating_System
and	O
PACT	O
programming	O
models	O
you	O
can	O
read	O
our	O
paper	O
//	O
"	O
MapReduce	B-Operating_System
and	O
PACT	O
-	O
Comparing	O
Data	O
Parallel	O
Programming	O
Models	O
"	O
//	O
(	O
see	O
our	O
)	O
.	O
</s>
