Hi all, have you ever observed, ordering of tables...
# troubleshooting
s
Hi all, have you ever observed, ordering of tables in join query, impacts the join output, for example, o/p of
Copy code
select 
   tb1.col1, 
   tb1.col2, 
   tb1.col3, 
   tb2.col1
from table1 as tb1
left join table2 as tb2
on tb1.col1 = tb2.col3
is different than
Copy code
select 
   tb1.col1, 
   tb1.col2, 
   tb1.col3, 
   tb2.col1
from table2 as tb2
left join table1 as tb1
on tb1.col1 = tb2.col3
d
For a streaming inner join, I would expect the exact order in which results are produced to vary from run to run based on inconsistencies in the relative ordering between elements of the two input streams (since the sources are racing against each other in different threads) -- but I would expect eventual consistency regardless of which table is on the left. What are you seeing?
a
These joins are not equivalent, so expecting the output to be the same is optimistic?
j
From a SQL semantic perspective, a left outer join of A and B is not equivalent to a left outer join of B and A. Therefore, it is expected that the results will be different.
s
Sorry, for the
red herring
, as @David Anderson suggested, initially, because of difference in size and consistencies among two Kafka streams, the results appeared to be different, but eventually, it caught up, and the final outcomes were identical.
a
That’s data-dependent, since the two queries behave very different if there isn’t matching rows in the other stream.
✅ 1