(&self, stmt: ResetVariable)
| 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(); |
no test coverage detected