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

Function form_identifier

datafusion/sql/src/expr/identifier.rs:282–308  ·  view source on GitHub ↗

(relation, column name)

(idents: &[String])

Source from the content-addressed store, hash-verified

280
281// (relation, column name)
282fn form_identifier(idents: &[String]) -> Result<(Option<TableReference>, &String)> {
283 match idents.len() {
284 1 => Ok((None, &idents[0])),
285 2 => Ok((
286 Some(TableReference::Bare {
287 table: idents[0].clone().into(),
288 }),
289 &idents[1],
290 )),
291 3 => Ok((
292 Some(TableReference::Partial {
293 schema: idents[0].clone().into(),
294 table: idents[1].clone().into(),
295 }),
296 &idents[2],
297 )),
298 4 => Ok((
299 Some(TableReference::Full {
300 catalog: idents[0].clone().into(),
301 schema: idents[1].clone().into(),
302 table: idents[2].clone().into(),
303 }),
304 &idents[3],
305 )),
306 _ => internal_err!("Incorrect number of identifiers: {}", idents.len()),
307 }
308}
309
310fn search_dfschema<'ids, 'schema>(
311 ids: &'ids [String],

Callers 3

test_form_identifierFunction · 0.85

Calls 3

lenMethod · 0.45
intoMethod · 0.45
cloneMethod · 0.45

Tested by 1

test_form_identifierFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…