...
The workflow of LHS-generated changes to outputs is shown below. Each step is cumulative with the previous step. Note that the only real difference between LEFT and INNER is that the LEFT will output when the transition is (k,null) → (k, not-null). Any other transitions from LHS events are identical between Inner and Left joinjoin outputs are shown below.
LHS Event (key, extracted fk) | To which RHS-partition? | RHS-0 State | RHS-1 State | Inner Join Output | Left Join Output | Execute Join Logic? | Notes | Inner-Join SubscriptionWrapper Instruction | |
---|---|---|---|---|---|---|---|---|---|
Publish new event | (k,1) | RHS-0 | (1,foo) | (k,1,foo) | (k,1,foo) | Yes, Inner/Left | Normal fk-join induced by LHS event | to RHS-0: | |
Publish update to event by changing fk | (k,1) → (k,2) | RHS-1 | (1,foo) | (k,null) | (k,nullJoinResult) | NoLEFT | Must indicate a delete because there is currently no (fk,value) in RHS with key=2, and (k,1,foo) is no longer valid output. | to RHS-0: DELETE_KEY_NO_PROPAGATE to RHS-1: | |
Publish update to event | (k,2) → (k,3) | RHS-0 | (1,foo) | (k,null) | (k,nullJoinResult) | NoLEFT | Ideally would not publish a delete with Inner Join, but we do not maintain sufficient state to know that the (k,2) update resulted in a null output and we don't need to do it again. | to RHS-0: DELETE_KEY_NO_PROPAGATE to RHS-1: | |
Publish a value to RHS-0 | - | - | (1,foo) | (k,3,bar) | (k,3,bar) | Yes, Inner/Left | Performs prefix scan join | - | |
Delete k | (k,3) → (k,null) | RHS-0 | (1,foo) | (k,null) | (k,nullJoinResult) | NoLEFT | Propagate null/delete through the sub-topology | to RHS-0: DELETE_KEY_AND_PROPAGATE | |
Publish original event again | (k,null) → (k,1) | RHS-0 | (1,foo) | (k,1,foo) | (k,1,foo) | Yes, Inner/Left | Normal fk-join induced by LHS event | to RHS-0: | |
Publish to LHS | (q,10) | RHS-1 | (1,foo) | Nothing | (q, nullJoinResult) | LEFT ONLY | Only real difference between Inner and Outer | - | |
Publish a value to RHS-1 | - | - | (1,foo) | (q,baz) | (q,10,baz) | (q,10,baz) | Yes, Inner/Left | Normal fk-join induced by LHS event | to RHS-1: |
...