Professional Documents
Culture Documents
Seventh
Seventh
• A component is a program.
• In these components
the record format
metadata does not
change from input to
output
• Single field:id
• Multiple field: { last_name; first_name }
• Modifiers: { id descending }
• In these components
the record format
metadata typically
changes (goes
through a transfor-
mation) from input
to output
id+1000000
Output record format:
record
decimal(7) id;
string(8) last_name;
date(”YYYY.MM.DD”) bday;
end 1000345Smith 1963.09.02
a b c
x y z
out :: trans(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: fn(in.c);
end;
9 45 QF
out :: trans(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: fn(in.c);
end;
9 45 QF
out :: trans(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: fn(in.c);
end;
out :: trans(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: fn(in.c);
end;
44 9 RG
out :: trans(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: fn(in.c);
end;
44 9 RG
0345Smith Bristol 56
0121Forth Bristol 7 Bristol 63
0322Jones Compton 12 Compton 12
0212Spade London 8
0492West London 23 London 31
0221Black New York 42 New York 42
avg max
count min
first product
last sum
0345Bristol 561997/09/24
0212London 81900/01/01
0322Compton 121997/04/02
0492London 231997/11/23
0121Bristol 71996/12/11
0221New York 421900/01/01
0121Bristol 71996/12/11
0212London 81900/01/01
...
a b c a q r
*join-type = Full
Align inputs by key Outer join
a b c a q r
a x q
Align inputs by a
G 234 42 G NY 4
Align inputs by a
G 234 42 G NY 4
Align inputs by a
Align inputs by a
G 234 42 G NY 4
Align inputs by a
G 234 42 G NY 4
Align inputs by a
G 24 NY
Align inputs by a
G 24 NY
Confidential & Proprietary
8.Records arrive at input
H 79 23 K IL 8
Align inputs by a
H 79 23 K IL 8
Align inputs by a
H 79 23 K IL 8
Align inputs by a
Align inputs by a
H 79 23
K IL 8
Align inputs by a
H 79 23
K IL 8
Align inputs by a
H 89 XX
K IL 8
Align inputs by a
H 89 XX
Confidential & Proprietary
Exercise 7: Join Data
Sorts it by city.
• Open figure-06.
• Options:
• join-type: Inner, Outer or Explicit (other).
• dedupn: Call the transform function only once for any
matching record on input n. Defaults to false.
• record-requiredn: Call transform function for all keys,
even if there is not a matching record for input n.
Defaults to true. Only used if join-type is Explicit.