Database Reference
In-Depth Information
martha
astrid
jackson
rosita
christina
adelaide
wilfred
Well, he's a popular guy.
How it works…
Let's take a look at the second example in a little more detail.
(?<- (stdout) [?companion] (doctor ?companion ?n ) (= ?n 10))
The predicates are evaluated once for each row in the input data. Once a name has been
bound to one predicate, it will keep that value throughout all the predicates. Moreover,
a row is only output when all the predicates pass.
(?<- (stdout) [?companion] (doctor ?companion ?n) (= ?n 10) )
This predicate only passes where ?n is bound to 10. Since all the predicates have to pass
successfully, this only returns the companions for Doctor number 10.
There's more
Variable binding, which we saw in this recipe, is a well-known feature of data-oriented
systems. Prolog ( http://www.learnprolognow.org/ ), for example, uses it extensively.
Distributing data with Apache HDFS
One of the best features of Hadoop is the Hadoop Distributed File System. This creates
a network of computers that automatically synchronize their data, making our input data
available to all the computers. Not having to worry about how the data gets distributed
makes our lives much easier.
For this recipe, we'll put a ile into HDFS and read it back out using Cascalog, line by line.
 
Search WWH ::




Custom Search