The current implementation of [KIP-213 |https://cwiki.apache.org/confluence/display/KAFKA/KIP-213+Support+non-key+joining+in+KTable] of Foreign Key Join between two KTables is opinionated in terms of storage layer.
Independently of the Materialization method provided in the method argument, it generates an intermediary RocksDB state store. Thus, even when the Materialization method provided is "in memory", it will use RocksDB under-the-hood for this internal state-store.
- IT Tests: Having an implicit materialization method for state-store affects tests using foreign key state-stores. [On windows based systems |https://stackoverflow.com/questions/50602512/failed-to-delete-the-state-directory-in-ide-for-kafka-stream-application], that are affected by the RocksDB filesystem removal problem, an approach to avoid the bug is to use in-memory state-stores (rather than exception swallowing). Having the intermediate RocksDB storage being created disregarding materialization method forces any IT test to necessarily use the manual FS deletion with exception swallowing hack.
- Short lived Streams: Ktables can be short lived in a way that neither persistent storage nor change-logs creation are desired. The current implementation prevents this.
One possible solution is to use a similar materialization method (to the one provided in the argument) when creating the intermediary Foreign Key state-store. If the Materialization is in memory and without changelog, the same happens in the intermediate state-sore.