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

Function remove_scope

datafusion/expr/src/higher_order_function.rs:1330–1354  ·  view source on GitHub ↗
(
    vars: &mut HashMap<String, Vec<FieldRef>>,
    scope: &[String],
)

Source from the content-addressed store, hash-verified

1328}
1329
1330fn remove_scope(
1331 vars: &mut HashMap<String, Vec<FieldRef>>,
1332 scope: &[String],
1333) -> Result<()> {
1334 for param in scope {
1335 match vars.entry_ref(param) {
1336 EntryRef::Occupied(mut v) => {
1337 if v.get().len() == 1 {
1338 v.remove();
1339 } else {
1340 v.get_mut().pop().ok_or_else(|| {
1341 internal_datafusion_err!(
1342 "every entry should have at least one field"
1343 )
1344 })?;
1345 }
1346 }
1347 EntryRef::Vacant(_v) => {
1348 return internal_err!("no empty value should be in the map");
1349 }
1350 }
1351 }
1352
1353 Ok(())
1354}
1355
1356fn all_unique(params: &[String]) -> bool {
1357 match params.len() {

Callers 1

Calls 5

get_mutMethod · 0.80
lenMethod · 0.45
getMethod · 0.45
removeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…