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

Method reset_variable

datafusion/core/src/execution/context/mod.rs:1150–1176  ·  view source on GitHub ↗
(&self, stmt: ResetVariable)

Source from the content-addressed store, hash-verified

1148 }
1149
1150 async fn reset_variable(&self, stmt: ResetVariable) -> Result<()> {
1151 let variable = stmt.variable;
1152 if variable.starts_with("datafusion.runtime.") {
1153 return self.reset_runtime_variable(&variable);
1154 }
1155
1156 let mut state = self.state.write();
1157 state.config_mut().options_mut().reset(&variable)?;
1158
1159 // Refresh UDFs to ensure configuration-dependent behavior updates
1160 let config_options = state.config().options();
1161 let udfs_to_update: Vec<_> = state
1162 .scalar_functions()
1163 .values()
1164 .filter_map(|udf| {
1165 udf.inner()
1166 .with_updated_config(config_options)
1167 .map(Arc::new)
1168 })
1169 .collect();
1170
1171 for udf in udfs_to_update {
1172 state.register_udf(udf)?;
1173 }
1174
1175 Ok(())
1176 }
1177
1178 fn set_runtime_variable(&self, variable: &str, value: &str) -> Result<()> {
1179 let key = variable.strip_prefix("datafusion.runtime.").unwrap();

Callers 1

execute_logical_planMethod · 0.80

Calls 14

options_mutMethod · 0.80
config_mutMethod · 0.80
collectMethod · 0.80
writeMethod · 0.45
resetMethod · 0.45
optionsMethod · 0.45
configMethod · 0.45
valuesMethod · 0.45
scalar_functionsMethod · 0.45
mapMethod · 0.45
with_updated_configMethod · 0.45

Tested by

no test coverage detected