Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Hash-join/TXR/hash-join.txr
Normal file
19
Task/Hash-join/TXR/hash-join.txr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
(defvar age-name '((27 Jonah)
|
||||
(18 Alan)
|
||||
(28 Glory)
|
||||
(18 Popeye)
|
||||
(28 Alan)))
|
||||
|
||||
(defvar nemesis-name '((Jonah Whales)
|
||||
(Jonah Spiders)
|
||||
(Alan Ghosts)
|
||||
(Alan Zombies)
|
||||
(Glory Buffy)))
|
||||
|
||||
(defun hash-join (left left-key right right-key)
|
||||
(let ((join-hash [group-by left-key left])) ;; hash phase
|
||||
(append-each ((r-entry right)) ;; join phase
|
||||
(collect-each ((l-entry [join-hash [right-key r-entry]]))
|
||||
^(,l-entry ,r-entry)))))
|
||||
|
||||
(format t "~s\n" [hash-join age-name second nemesis-name first])
|
||||
Loading…
Add table
Add a link
Reference in a new issue