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

Function process_replacements

benchmarks/src/sql_benchmark.rs:1352–1357  ·  view source on GitHub ↗

Replace all `${KEY}` or `${KEY:-default}` placeholders in a string according to the mapping. Also handles `${KEY:-default|True value|false value}` syntax.

(
    input: &str,
    replacement_map: &HashMap<String, String>,
)

Source from the content-addressed store, hash-verified

1350/// Replace all `${KEY}` or `${KEY:-default}` placeholders in a string according to the mapping.
1351/// Also handles `${KEY:-default|True value|false value}` syntax.
1352fn process_replacements(
1353 input: &str,
1354 replacement_map: &HashMap<String, String>,
1355) -> Result<String> {
1356 process_replacements_with_env(input, replacement_map, |key| std::env::var(key).ok())
1357}
1358
1359fn process_replacements_with_env(
1360 input: &str,

Callers 4

process_queryMethod · 0.85
process_resultsMethod · 0.85
read_lineMethod · 0.85
read_query_from_fileFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…