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

Method reset_runtime_variable

datafusion/core/src/execution/context/mod.rs:1221–1261  ·  view source on GitHub ↗
(&self, variable: &str)

Source from the content-addressed store, hash-verified

1219 }
1220
1221 fn reset_runtime_variable(&self, variable: &str) -> Result<()> {
1222 let key = variable.strip_prefix("datafusion.runtime.").unwrap();
1223
1224 let mut state = self.state.write();
1225
1226 let mut builder = RuntimeEnvBuilder::from_runtime_env(state.runtime_env());
1227 match key {
1228 "memory_limit" => {
1229 builder.memory_pool = None;
1230 }
1231 "max_temp_directory_size" => {
1232 builder =
1233 builder.with_max_temp_directory_size(DEFAULT_MAX_TEMP_DIRECTORY_SIZE);
1234 }
1235 "temp_directory" => {
1236 builder.disk_manager_builder = Some(DiskManagerBuilder::default());
1237 }
1238 "metadata_cache_limit" => {
1239 builder = builder.with_metadata_cache_limit(DEFAULT_METADATA_CACHE_LIMIT);
1240 }
1241 "list_files_cache_limit" => {
1242 builder = builder
1243 .with_object_list_cache_limit(DEFAULT_LIST_FILES_CACHE_MEMORY_LIMIT);
1244 }
1245 "list_files_cache_ttl" => {
1246 builder =
1247 builder.with_object_list_cache_ttl(DEFAULT_LIST_FILES_CACHE_TTL);
1248 }
1249 "file_statistics_cache_limit" => {
1250 builder = builder.with_file_statistics_cache_limit(
1251 DEFAULT_FILE_STATISTICS_MEMORY_LIMIT,
1252 );
1253 }
1254 _ => return plan_err!("Unknown runtime configuration: {variable}"),
1255 };
1256 *state = SessionStateBuilder::from(state.clone())
1257 .with_runtime_env(Arc::new(builder.build()?))
1258 .build();
1259
1260 Ok(())
1261 }
1262
1263 /// Parse memory limit from string to number of bytes
1264 /// Supports formats like '1.5G', '100M', '512K'

Callers 1

reset_variableMethod · 0.80

Calls 12

newFunction · 0.85
strip_prefixMethod · 0.80
writeMethod · 0.45
runtime_envMethod · 0.45
buildMethod · 0.45
with_runtime_envMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected