MCPcopy Create free account
hub / github.com/apache/datafusion / add_var_provider

Method add_var_provider

datafusion/expr/src/execution_props.rs:124–136  ·  view source on GitHub ↗

Registers a variable provider, returning the existing provider, if any

(
        &mut self,
        var_type: VarType,
        provider: Arc<dyn VarProvider + Send + Sync>,
    )

Source from the content-addressed store, hash-verified

122
123 /// Registers a variable provider, returning the existing provider, if any
124 pub fn add_var_provider(
125 &mut self,
126 var_type: VarType,
127 provider: Arc<dyn VarProvider + Send + Sync>,
128 ) -> Option<Arc<dyn VarProvider + Send + Sync>> {
129 let mut var_providers = self.var_providers.take().unwrap_or_default();
130
131 let old_provider = var_providers.insert(var_type, provider);
132
133 self.var_providers = Some(var_providers);
134
135 old_provider
136 }
137
138 /// Returns the provider for the `var_type`, if any
139 #[expect(clippy::needless_pass_by_value)]

Callers 1

register_variableMethod · 0.80

Calls 2

takeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected