Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Hash-join/11l/hash-join.11l
Normal file
24
Task/Hash-join/11l/hash-join.11l
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
F hash_join(table1, table2)
|
||||
DefaultDict[String, [(Int, String)]] h
|
||||
L(s) table1
|
||||
h[s[1]].append(s)
|
||||
|
||||
[((Int, String), (String, String))] res
|
||||
L(r) table2
|
||||
L(s) h[r[0]]
|
||||
res [+]= (s, r)
|
||||
R res
|
||||
|
||||
V table1 = [(27, ‘Jonah’),
|
||||
(18, ‘Alan’),
|
||||
(28, ‘Glory’),
|
||||
(18, ‘Popeye’),
|
||||
(28, ‘Alan’)]
|
||||
V table2 = [(‘Jonah’, ‘Whales’),
|
||||
(‘Jonah’, ‘Spiders’),
|
||||
(‘Alan’, ‘Ghosts’),
|
||||
(‘Alan’, ‘Zombies’),
|
||||
(‘Glory’, ‘Buffy’)]
|
||||
|
||||
L(row) hash_join(table1, table2)
|
||||
print(row)
|
||||
Loading…
Add table
Add a link
Reference in a new issue