Databases Reference
In-Depth Information
achieved. Also, the ordering of predicates is irrelevant. Even though no join operation
was specified, this code required an implied join of the
person
and
age
data:
(
def
person
[
;; [person]
[
"alice"
]
[
"bob"
]
[
"chris"
]
[
"david"
]
[
"emily"
]
[
"george"
]
[
"gary"
]
[
"harold"
]
[
"kumar"
]
[
"luanne"
]
])
(
def
age
[
;; [person age]
[
"alice"
28
]
[
"bob"
33
]
[
"chris"
40
]
[
"david"
25
]
[
"emily"
25
]
[
"george"
31
]
[
"gary"
28
]
[
"kumar"
27
]
[
"luanne"
36
]
])
Nathan Marz has
an excellent tutorial
about different kinds of joins and filters in Cas‐
calog.
Next let's modify the query to show the age for each person. We simply add the
?age
variable to the output tuple scheme:
user=>
(
?<-
(
stdout
)
[
?person
?age
]
(
age
?person
?age
)
(
<
?age
30
))
alice
28
david
25
emily
25
gary
28
kumar
27
A
gist on GitHub
shows building and running this app. If your results look similar, you
should be good to go.
Otherwise, if you have any troubles, contact the Cascalog developer community—which
in general is a subset of the Cascading developer community. You can also reach the