Re: coGroup Iterator NoSuchElement

2015-06-04 Thread Mustafa Elbehery
@ Stephan, I was trying to follow the concept of *Nest Join. *In other words, I wanted to follow certain implementation to achieve my goal. @Fabian, Well, solving the exception this way will lead to incorrect result, as they key will always exist on one side, the iterator of the other side will co

Re: coGroup Iterator NoSuchElement

2015-06-04 Thread Fabian Hueske
I am not sure if I got your question right. You can easily prevent the NoSuchElementException, but calling next() only if hasNext() returns true. 2015-06-04 11:18 GMT+02:00 Mustafa Elbehery : > Yes, Its working now .. But my assumption is that I want to join different > datasets on the common ke

Re: coGroup Iterator NoSuchElement

2015-06-04 Thread Stephan Ewen
The regular JOIN has the semantics of an inner join, filtering out cases where no matching tuple is found on one side. CoGroup follows the semantics of an outer join on groups, delivering also empty groups on some sides. On Thu, Jun 4, 2015 at 11:18 AM, Mustafa Elbehery wrote: > Yes, Its workin

Re: coGroup Iterator NoSuchElement

2015-06-04 Thread Mustafa Elbehery
Yes, Its working now .. But my assumption is that I want to join different datasets on the common key, so it will be normal to have many tuples on side, which does not exist on the other side .. How to fix that ?!! On Thu, Jun 4, 2015 at 11:00 AM, Fabian Hueske wrote: > Hi, > > one of the itera

Re: coGroup Iterator NoSuchElement

2015-06-04 Thread Fabian Hueske
Hi, one of the iterables of a CoGroup function can be empty. Calling iterator.next() on an empty iterator raises the NoSuchElementException. This is the expected behavior of the function. Are you sure your assumption about your data are correct, i.e., that the iterator should always have (at leas

Re: coGroup Iterator NoSuchElement

2015-06-04 Thread Mustafa Elbehery
Hi, public static class ComputeStudiesProfile implements CoGroupFunction { Person person; @Override public void coGroup(Iterable iterable, Iterable iterable1, Collector collector) throws Exception { Iterator iterator = iterable.iterator(); person = iterator.next();

Re: coGroup Iterator NoSuchElement

2015-06-03 Thread Stephan Ewen
Hi! The code snippet is not very revealing. Can you also shot the implementations of the CoGroupFunctions? Thanks! On Wed, Jun 3, 2015 at 3:50 PM, Mustafa Elbehery wrote: > Code Snippet :) > > DataSet updatedPersonOne = inPerson.coGroup(inStudent) >.where("name").eq

Re: coGroup Iterator NoSuchElement

2015-06-03 Thread Mustafa Elbehery
Code Snippet :) DataSet updatedPersonOne = inPerson.coGroup(inStudent) .where("name").equalTo("name") .with(new ComputeStudiesProfile()); DataSet updatedPersonTwo = updatedPersonOne.coGroup(inJobs) .where("name").equ

coGroup Iterator NoSuchElement

2015-06-03 Thread Mustafa Elbehery
Hi, I am trying to write two coGrouprs in sequence on the same ETL .. In use common dataset in both of them, in the first coGroup I update the initial dataset and retrieve the result in a new dataset object. Then I use the result in the second coGroup with another new dataset. While debugging, I