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

Function all_unique

datafusion/sql/src/expr/function.rs:1189–1205  ·  view source on GitHub ↗

After normalization with [normalize_ident], check whether all params are unique [normalize_ident]: crate::utils::normalize_ident

(params: &[sqlparser::ast::LambdaFunctionParameter])

Source from the content-addressed store, hash-verified

1187///
1188/// [normalize_ident]: crate::utils::normalize_ident
1189fn all_unique(params: &[sqlparser::ast::LambdaFunctionParameter]) -> bool {
1190 match params.len() {
1191 0 | 1 => true,
1192 2 => {
1193 crate::utils::normalize_ident(params[0].name.clone())
1194 != crate::utils::normalize_ident(params[1].name.clone())
1195 }
1196 _ => {
1197 let mut set = HashSet::with_capacity(params.len());
1198
1199 params
1200 .iter()
1201 .map(|p| crate::utils::normalize_ident(p.name.clone()))
1202 .all(|p| set.insert(p))
1203 }
1204 }
1205}

Callers 1

sql_function_to_exprMethod · 0.70

Calls 7

normalize_identFunction · 0.85
allMethod · 0.80
lenMethod · 0.45
cloneMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…