Yes, unfortunately, this is done before the logical plan is created and optimized and this is the only place where I can get the information needed to create this node. I tried to do this when building the topology after the rewriting but it was impossible without major refactoring as currently,  there is not a clear separation between logical and physical plan. 