Hash join: Difference between revisions
Content added Content deleted
m (→{{header|LFE}}: removed superfluous colon) |
m (→{{header|LFE}}: Split out into more functions for increased readability) |
||
Line 673: | Line 673: | ||
'() |
'() |
||
table)) |
table)) |
||
(defun get-hash (col hash-table) |
|||
(proplists:get_value |
|||
(proplists:get_value col r) |
|||
⚫ | |||
(defun merge (row-1 row-2) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
(defun hash-join (table-1 col-1 table-2 col-2) |
(defun hash-join (table-1 col-1 table-2 col-2) |
||
(let ((hashed (hash col-1 table-1))) |
(let ((hashed (hash col-1 table-1))) |
||
(lc ((<- r table-2)) |
(lc ((<- r table-2)) |
||
(lc ((<- s ( |
(lc ((<- s (get-hash col-2 hashed))) |
||
(merge r s))))) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</lang> |
</lang> |
||