Reuse connection to Extract,Consume and execute substrait query plans #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Up until now, we have been creating new connections to interact with substrait. This was necessary to circumvent the client context lock.
However, this was a brittle solution and especially problematic when dealing with temporary objects since these are not passed around new connections.
This PR allows us to reuse the same connection by utilizing a new flexible relation binder that allows us to consume and execute substrait plans from within the same connection; it also changes the
from_substrait
functions to use bind replace.Aditionally, extracting plans will also go through a specialized code path, to allow us to use the same connection.
Since substrait also uses special options (e.g., some optimizations are disabled), these are set and reset on the original connection.