Skip to content

Commit 04f7aed

Browse files
committed
add function
1 parent 0e030ec commit 04f7aed

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/channel_resolver_ext.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ pub(crate) fn get_distributed_channel_resolver(
2323
.ok_or_else(|| exec_datafusion_err!("ChannelResolver not present in the session config"))
2424
}
2525

26+
/// Check if there is a distributed channel resolver registered with this [`SessionConfig`].
27+
pub fn has_distributed_channel_resolver(cfg: &SessionConfig) -> bool {
28+
cfg.get_extension::<ChannelResolverExtension>().is_some()
29+
}
30+
2631
#[derive(Clone)]
2732
struct ChannelResolverExtension(Arc<dyn ChannelResolver + Send + Sync>);
2833

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mod protobuf;
1414
#[cfg(any(feature = "integration", test))]
1515
pub mod test_utils;
1616

17-
pub use channel_resolver_ext::{BoxCloneSyncChannel, ChannelResolver};
17+
pub use channel_resolver_ext::{has_distributed_channel_resolver, BoxCloneSyncChannel, ChannelResolver};
1818
pub use distributed_ext::DistributedExt;
1919
pub use distributed_physical_optimizer_rule::DistributedPhysicalOptimizerRule;
2020
pub use execution_plans::{

0 commit comments

Comments
 (0)