Reset a configuration option back to its default value
(&mut self, key: &str)
| 1472 | |
| 1473 | /// Reset a configuration option back to its default value |
| 1474 | fn reset(&mut self, key: &str) -> Result<()> { |
| 1475 | let Some((prefix, rest)) = key.split_once('.') else { |
| 1476 | return _config_err!("could not find config namespace for key \"{key}\""); |
| 1477 | }; |
| 1478 | |
| 1479 | if prefix != "datafusion" { |
| 1480 | return _config_err!("Could not find config namespace \"{prefix}\""); |
| 1481 | } |
| 1482 | |
| 1483 | let (section, rem) = rest.split_once('.').unwrap_or((rest, "")); |
| 1484 | if rem.is_empty() { |
| 1485 | return _config_err!("could not find config field for key \"{key}\""); |
| 1486 | } |
| 1487 | |
| 1488 | match section { |
| 1489 | "catalog" => self.catalog.reset(rem), |
| 1490 | "execution" => self.execution.reset(rem), |
| 1491 | "optimizer" => { |
| 1492 | if rem == "enable_dynamic_filter_pushdown" { |
| 1493 | let defaults = OptimizerOptions::default(); |
| 1494 | self.optimizer.enable_dynamic_filter_pushdown = |
| 1495 | defaults.enable_dynamic_filter_pushdown; |
| 1496 | self.optimizer.enable_topk_dynamic_filter_pushdown = |
| 1497 | defaults.enable_topk_dynamic_filter_pushdown; |
| 1498 | self.optimizer.enable_join_dynamic_filter_pushdown = |
| 1499 | defaults.enable_join_dynamic_filter_pushdown; |
| 1500 | Ok(()) |
| 1501 | } else { |
| 1502 | self.optimizer.reset(rem) |
| 1503 | } |
| 1504 | } |
| 1505 | "explain" => self.explain.reset(rem), |
| 1506 | "sql_parser" => self.sql_parser.reset(rem), |
| 1507 | "format" => self.format.reset(rem), |
| 1508 | other => _config_err!("Config value \"{other}\" not found on ConfigOptions"), |
| 1509 | } |
| 1510 | } |
| 1511 | } |
| 1512 | |
| 1513 | /// This namespace is reserved for interacting with Foreign Function Interface |
no test coverage detected