Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
15
Task/Hash-join/J/hash-join-1.j
Normal file
15
Task/Hash-join/J/hash-join-1.j
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
table1=: ;:;._2(0 :0)
|
||||
27 Jonah
|
||||
18 Alan
|
||||
28 Glory
|
||||
18 Popeye
|
||||
28 Alan
|
||||
)
|
||||
|
||||
table2=: ;:;._2(0 :0)
|
||||
Jonah Whales
|
||||
Jonah Spiders
|
||||
Alan Ghosts
|
||||
Alan Zombies
|
||||
Glory Buffy
|
||||
)
|
||||
9
Task/Hash-join/J/hash-join-2.j
Normal file
9
Task/Hash-join/J/hash-join-2.j
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
hash=: ]
|
||||
dojoin=:3 :0
|
||||
c1=. {.{.y
|
||||
c2=. (1 {"1 y) -. a:
|
||||
c3=. (2 {"1 y) -. a:
|
||||
>{c1;c2;<c3
|
||||
)
|
||||
|
||||
JOIN=: ; -.&a: ,/each(hash@{."1 <@dojoin/. ]) (1 1 0&#inv@|."1 table1), 1 0 1#inv"1 table2
|
||||
16
Task/Hash-join/J/hash-join-3.j
Normal file
16
Task/Hash-join/J/hash-join-3.j
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
JOIN
|
||||
┌─────┬──┬───────┐
|
||||
│Jonah│27│Whales │
|
||||
├─────┼──┼───────┤
|
||||
│Jonah│27│Spiders│
|
||||
├─────┼──┼───────┤
|
||||
│Alan │18│Ghosts │
|
||||
├─────┼──┼───────┤
|
||||
│Alan │18│Zombies│
|
||||
├─────┼──┼───────┤
|
||||
│Alan │28│Ghosts │
|
||||
├─────┼──┼───────┤
|
||||
│Alan │28│Zombies│
|
||||
├─────┼──┼───────┤
|
||||
│Glory│28│Buffy │
|
||||
└─────┴──┴───────┘
|
||||
Loading…
Add table
Add a link
Reference in a new issue