LEFTJOIN result is equal to JOIN result even if there are no "matching partners"

Post Reply
stefan
Posts: 85
Joined: Tue Jul 12, 2016 1:03 pm

LEFTJOIN result is equal to JOIN result even if there are no "matching partners"

Post by stefan » Sun Nov 20, 2016 11:11 pm

Hello,

I have to streams that I would like to join.
The left stream (nodes) always has one more tuple than the right stream (relations between nodes). Therefore I use the LEFTJOIN operator. My query looks like the following:

Code: Select all

#RUNQUERY
joinedNodeRel := LEFTJOIN(
	{
		predicate = 'n_uuid = r_uuid AND n_pathCnt = r_pathCnt AND n_nodeCnt = r_relCnt'
	}, mobiReqPathNodes, mobiReqPathRels 
)
In my test case, I have 8 nodes (left stream) and 7 relations (right stream) that should be combined. As I understood the LEFTJOIN Operator, the 8th node should be listed even if there is no join partner (no corresponding relation). But in my case the result is always the same as the result of the regular join. The 8th node is missing.

I tried to build a workaround through filtering the last node of the stream, do the regular join with the 7 nodes, use a MAP Operator to convert the 8th node to the same structure like the other 7 tuples and use a UNION Operator to get the full result. But in this case The 8th node is "faster" and therefore the first element in the stream. If I use the SORT Operator (especially in ascending order) I get strange results even if I use a window operator with slide to get the same start timestamp. I think that the window is not configured properly - I will have a look tomorrow.

Does anybody have an idea what I should change in my LEFTJOIN to get it running?

greetings,
Stefan

User avatar
Michael Brand
Posts: 12
Joined: Tue Jul 29, 2014 9:56 am
Location: Oldenburg, Germany
Contact:

Re: LEFTJOIN result is equal to JOIN result even if there are no "matching partners"

Post by Michael Brand » Mon Nov 21, 2016 11:29 am

Hi Stefan,

your understanding of the LEFTJOIN is correct, so there might be a problem with the implementation. I will take a look at it today.
Greetings
Michael

User avatar
Michael Brand
Posts: 12
Joined: Tue Jul 29, 2014 9:56 am
Location: Oldenburg, Germany
Contact:

Re: LEFTJOIN result is equal to JOIN result even if there are no "matching partners"

Post by Michael Brand » Mon Nov 21, 2016 2:58 pm

I pushed a solution, your problem should be fixed with the next nightly build. Please let me know, whether it works for you.
Greetings
Michael

stefan
Posts: 85
Joined: Tue Jul 12, 2016 1:03 pm

Re: LEFTJOIN result is equal to JOIN result even if there are no "matching partners"

Post by stefan » Wed Nov 23, 2016 12:39 pm

I tested your solution but I cannot find a difference. If you like I can provide sample data. I think with this data it should be easy to check if there is a problem in Leftjoin or I am using the function just in the wrong way. I think its to much data for a post, so please let me know how I can provide it (email, JIRA, etc.)

greetings,
Stefan

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: LEFTJOIN result is equal to JOIN result even if there are no "matching partners"

Post by Marco Grawunder » Wed Nov 23, 2016 12:50 pm

Could you please provide your whole query? The left join works only if both inputs provide a window (else the decission cannot be made, if an element has no further matching partners.)

I assigned https://jira.odysseus.offis.uni-oldenbu ... e/ODY-1180 to you as reporter. Here you could upload your query and your sample data.

Greetings,

Marco

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest