We often construct a new SessionContext in merge_insert, which can be expensive. Instead, we should re-use the same one.
In fact, we can probably just have one of them, and set the target partitions, and spill configuration to new values when we convert to SessionState.
We often construct a new
SessionContextinmerge_insert, which can be expensive. Instead, we should re-use the same one.In fact, we can probably just have one of them, and set the target partitions, and spill configuration to new values when we convert to
SessionState.