# Problem with left-join

**URL:** <https://forum.confluent.io/t/problem-with-left-join/7692>\
**Category:** Kafka Streams\
**Created:** [24 April 2023 15:27 UTC](https://forum.confluent.io/t/problem-with-left-join/7692 "2023-04-24T15:27:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damiano01](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/damiano01/32/2424_2.png) [@Damiano01](https://forum.confluent.io/u/Damiano01)\
**Post date:** [24 April 2023 15:27 UTC](https://forum.confluent.io/t/problem-with-left-join/7692/1 "2023-04-24T15:27:20Z")

</div>

Hi guys I have a problem with KStreams. I have a KTable T1 on which I perform a left join on a KTable T2.  
The result is converted to a KStream.

I would like for each update in table T2 the left-join to publish a message. But this does not always happen.

Sometimes I am forced to do a dummy update of T1, then later I can update T2 as much as I want and get the behavior I want.

Is it basically wrong to expect a join update when only the aggregate table is changed?

I also attach a piece of code to make the problem clearer.  
ProductFacility is the table I would like to update.

```
    kStream = productKTable.getKTable()
            .joiner()
            .leftJoin(
                    productFacilityKTable.getKTable(),
                    (product, productFacilities) -> {
                        if(productFacilities != null){
                            var facilities = new HashMap<String, ErpProductFacility>();
                            for (var productFacility : productFacilities) {
                                facilities.put(productFacility.facility, productFacility);
                            }
                            product.facilities = facilities;
                        }
                        return product;
                    },
                    ElMat.ephemeral()
            )
            .toStream()

```

Any help will be appreciated. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![mjsax](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mjsax/32/3113_2.png) [@mjsax](https://forum.confluent.io/u/mjsax)\
**Post date:** [25 April 2023 20:03 UTC](https://forum.confluent.io/t/problem-with-left-join/7692/2 "2023-04-25T20:03:47Z")

</div>

KTable by default use internal caches. You might want to disable caching, either globally for all KTables setting cache size to zero in the config, or on a per-table basis (for both input tables) by passing in a `Materialized` config object.

Cf. [Kafka Streams Memory Management | Confluent Documentation](https://docs.confluent.io/platform/current/streams/developer-guide/memory-mgmt.html)
