Return the function name, or a qualified stub that will never match any registered function if the name is schema-qualified. Detection (`contains_aggregate`) uses this to look up the function in the registry — a qualified name won't be found, so the aggregate check is a safe no-op. Extraction (`extract_aggregates`) will not reach this path for schema-qualified names because `convert_expr` rejects
(f: &ast::Function)
| 167 | /// safe no-op. Extraction (`extract_aggregates`) will not reach this path |
| 168 | /// for schema-qualified names because `convert_expr` rejects them first. |
| 169 | fn function_name(f: &ast::Function) -> String { |
| 170 | if f.name.0.len() > 1 { |
| 171 | // Return a sentinel that cannot match any registry entry. |
| 172 | // The actual rejection happens in convert_expr / convert_function_depth. |
| 173 | let qualified: String = f |
| 174 | .name |
| 175 | .0 |
| 176 | .iter() |
| 177 | .map(|p| match p { |
| 178 | ast::ObjectNamePart::Identifier(ident) => ident.value.clone(), |
| 179 | _ => String::new(), |
| 180 | }) |
| 181 | .collect::<Vec<_>>() |
| 182 | .join("."); |
| 183 | return format!("__schema_qualified__{qualified}"); |
| 184 | } |
| 185 | f.name |
| 186 | .0 |
| 187 | .iter() |
| 188 | .map(|p| match p { |
| 189 | ast::ObjectNamePart::Identifier(ident) => normalize_ident(ident), |
| 190 | _ => String::new(), |
| 191 | }) |
| 192 | .collect::<Vec<_>>() |
| 193 | .join(".") |
| 194 | } |
| 195 | |
| 196 | fn function_args_and_distinct(f: &ast::Function) -> (Vec<SqlExpr>, bool) { |
| 197 | let ast::FunctionArguments::List(args) = &f.args else { |
no test coverage detected