Created
July 27, 2012 15:46
-
-
Save t-ob/3188770 to your computer and use it in GitHub Desktop.
Cascalog joins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def short-urls | |
[["http://t.co/yERArQn0"] | |
["http://t.co/gI8TjreI"] | |
["http://t.co/CBsucpNm"] | |
["http://t.co/F74GG1oN"] | |
["http://t.co/hyoXObbU"]]) | |
(def longified-urls | |
[["http://t.co/yERArQn0" "http://news.sky.com/story/964624/olympic-lanes-open-traffic-delays-in-london"] | |
["http://t.co/CBsucpNm" "http://media.tumblr.com/tumblr_m65uu5UsrQ1r7h1lt.gif"] | |
["http://t.co/hyoXObbU" "http://twitpic.com/aa8rq1"]]) | |
(?<- (stdout) | |
[?url] | |
(short-urls ?url)) | |
;; RESULTS | |
;; ----------------------- | |
;; http://t.co/yERArQn0 | |
;; http://t.co/gI8TjreI | |
;; http://t.co/CBsucpNm | |
;; http://t.co/F74GG1oN | |
;; http://t.co/hyoXObbU | |
;; ----------------------- | |
(?<- (stdout) | |
[?short ?long] | |
(longified-urls ?short ?long)) | |
;; RESULTS | |
;; ----------------------- | |
;; http://t.co/yERArQn0 http://news.sky.com/story/964624/olympic-lanes-open-traffic-delays-in-london | |
;; http://t.co/CBsucpNm http://media.tumblr.com/tumblr_m65uu5UsrQ1r7h1lt.gif | |
;; http://t.co/hyoXObbU http://twitpic.com/aa8rq1 | |
;; ----------------------- | |
; Outer join with ungrounded variable | |
(?<- (stdout) | |
[?short !!long] | |
(short-urls ?short) | |
(longified-urls ?short !!long)) | |
;; RESULTS | |
;; ----------------------- | |
;; http://t.co/CBsucpNm http://media.tumblr.com/tumblr_m65uu5UsrQ1r7h1lt.gif | |
;; http://t.co/F74GG1oN null | |
;; http://t.co/gI8TjreI null | |
;; http://t.co/hyoXObbU http://twitpic.com/aa8rq1 | |
;; http://t.co/yERArQn0 http://news.sky.com/story/964624/olympic-lanes-open-traffic-delays-in-london | |
;; ----------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment