How to implement the division of two relations in mapreduce?

171 views Asked by At

I want to implement the division of two relations in MapReduce. I have two relations: T(A,B,C) and U(B,C). I know that enter image description here

for the relations R(A,B,D) and S(A,B). This is pretty much my scenario. I am not sure how I would go about implementing this in mapReduce. With my limited knowledge Im guessing there would be 3 map reduce jobs. I would assume the first round might be the (projection of B -C(T) x U) - T

Mapper 1 our input is either a tuple from T or U

If tuple t belongs to (a,b,c) from T then we have key: NULL and value ("T" a)

if tuple t belongs to (b,c) from U then we have key NULL and value (b,c "U")

With these values we can perform the cartesian product between ("T" a ) with the values (b,c "U") and emit the new key null and value (a,b,c)

Reducer 2 we remove from the new cartesian tuples any that are in the original table T and emit the tuples that are not contained in the original table.

I am confused about what I would do next. Whether it would be another mapper or could I use again a reducer for the next B -C projection? I'm not sure if I did the first round correctly. If anyone can tell me the steps how this would go preferably in pseudo-code that would me understand. Online I do not find any answers for this.

0

There are 0 answers