MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / ambiguous_ids

Method ambiguous_ids

src/repr/src/explain.rs:805–822  ·  view source on GitHub ↗

Find all IDs with colliding (unqualified) humanizations.

(&self, humanizer: &dyn ExprHumanizer)

Source from the content-addressed store, hash-verified

803
804 /// Find all IDs with colliding (unqualified) humanizations.
805 pub fn ambiguous_ids(&self, humanizer: &dyn ExprHumanizer) -> BTreeSet<GlobalId> {
806 let humanized = self
807 .0
808 .iter()
809 .flat_map(|(id, _)| humanizer.humanize_id_unqualified(*id).map(|hum| (hum, *id)));
810
811 let mut by_humanization = BTreeMap::<String, BTreeSet<GlobalId>>::new();
812 for (hum, id) in humanized {
813 by_humanization.entry(hum).or_default().insert(id);
814 }
815
816 by_humanization
817 .values()
818 .filter(|ids| ids.len() > 1)
819 .flatten()
820 .cloned()
821 .collect()
822 }
823}
824
825#[derive(

Callers 1

fmt_textMethod · 0.80

Calls 11

flat_mapMethod · 0.45
iterMethod · 0.45
mapMethod · 0.45
insertMethod · 0.45
entryMethod · 0.45
collectMethod · 0.45
flattenMethod · 0.45
filterMethod · 0.45
valuesMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected