Cartesian Join ( How to do using cascading )

33 views
Skip to first unread message

Raja

unread,
Apr 7, 2016, 2:03:21 PM4/7/16
to cascading-user
Hi,

   I  would like to know is it possible that we can do Cartesian join  in Cascading.
If  anyone can give  a simple clear example to understand Cartesian join in cascading?


Thanks in Advance,
Raja

Andre Kelpe

unread,
Apr 7, 2016, 2:56:18 PM4/7/16
to cascading-user
You can implement custom Joins by implementing the Joiner interface
and passing it to a CoGroup instance:

http://docs.cascading.org/cascading/3.0/javadoc/cascading-core/cascading/pipe/joiner/Joiner.html

http://docs.cascading.org/cascading/3.0/javadoc/cascading-core/cascading/pipe/CoGroup.html

- Andre
> --
> You received this message because you are subscribed to the Google Groups
> "cascading-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cascading-use...@googlegroups.com.
> To post to this group, send email to cascadi...@googlegroups.com.
> Visit this group at https://groups.google.com/group/cascading-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cascading-user/55eca95f-02c8-4740-be63-a796a4318e40%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
André Kelpe
an...@concurrentinc.com
http://concurrentinc.com

Raja

unread,
Apr 7, 2016, 4:10:59 PM4/7/16
to cascading-user
Hi ,

  Thanks for your reply.  Can you provide one simple example where I can see the cartesian join  being implemented in Cascading.

Thanks,
Raja

Ken Krugler

unread,
Apr 7, 2016, 4:35:30 PM4/7/16
to cascadi...@googlegroups.com
Assuming you have two pipes, then

Pipe cartesian = new CoGroup(“cartesian join”, p1, Fields.NONE, p2, Fields.NONE, new OuterJoin());

should do the trick.

If one of the pipes has a relatively small number of tuples, then it’s going to be much more efficient to use a HashJoin instead of a CoGroup (just make sure p2 is the pipe with the small number of tuples)

— Ken
--------------------------
Ken Krugler
custom big data solutions & training
Hadoop, Cascading, Cassandra & Solr



Baskar

unread,
Apr 8, 2016, 3:51:42 PM4/8/16
to cascading-user

Great.  That worked.  Thanks for your quick response.

Baskar
Reply all
Reply to author
Forward
0 new messages