Ergonomic way to setup/configure SessionContextExt
#1096
Merged
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.
Which issue does this PR close?
Closes #1092.
Rationale for this change
This change provides ergonomic way to configure SessionContextExt, similar to DataFusion context setup from using provided SessionStore.
What changes are included in this PR?
This change provides two new methods in
SessionContextExt
async fn standalone_with_state(state: SessionState)
andasync fn remote_with_state(url: &str,state: SessionState)
Which accepts pre configured
SessionState
as parameter.SessionState
should be configured in the same way like whenSessionContext
is configured in DataFusion.This change also exposes a
BallistaSessionConfigExt
which provides method to configure ballista specific settings like,BallistaConfiguration
, codecs or evenQueryPlanner
.LogicalExtensionCodec
andPhysicalExtensionCodec
can be changed as well:In this case logical and physical codec will be also be propagated to standalone.
Lastly, BallistaQueryPlanner can be replaced:
At the moment there is a hacky way telling ballista not to override provided planner with
.set_str(BALLISTA_PLANNER_OVERRIDE, "false");
as it is not possible to detect if the planner is changed.Are there any user-facing changes?
Introduction of two new methods and one extension to new functionality, no braking change
Notes:
ballista_core::object_store_registry::with_object_store_registry
deprecation in follow up commits when we expose configuration on scheduler and executor APIstandalone_with_state
may change slightly adding executor related configuration