Hey Austin, Indeed the most popular serialization/deserialization method for query plans is by using the RelJsonReader and RelJsonWriter. However, we are lacking a bit of test coverage around this feature so when new RelNodes are added it's easy to miss the required changes. Moreover, it's quite common for other projects to plug-in their own custom RelNode's so serialization happens outside the classes present in calcite core. We would happily accept contributions in this area so feel free to create a JIRA ticket and submit a PR.
Best, Stamatis On Mon, Sep 30, 2024 at 11:55 AM Austin Richardson <austin.richard...@teampicnic.com.invalid> wrote: > > Hi Calcite devs, > > Our team is currently experimenting with ideas for serialising and > deserialising optimised query plans using RelJsonWriter and RelJsonReader. > We noticed this is possible for pre-optimisation logical plans, but ran > into issues when trying to do so for post-optimisation execution plans. For > example, LogicalJoin implements the required constructor for serialisation > here > <https://calcite.apache.org/javadocAggregate/org/apache/calcite/rel/logical/LogicalJoin.html#%3Cinit%3E(org.apache.calcite.rel.RelInput)>, > but the specific JOIN implementations (e.g. EnumerableBatchNestedLoopJoin) > do not. > > Considering this, is there a preferred way for serialising and > deserialising optimised query plans? We wanted to ensure we aren’t missing > something here. > > Thank you, > > Austin