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

Function normalize_cols_non_exist

datafusion/expr/src/expr_rewriter/mod.rs:474–489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

472
473 #[test]
474 fn normalize_cols_non_exist() {
475 // test normalizing columns when the name doesn't exist
476 let expr = col("a") + col("b");
477 let schema_a =
478 make_schema_with_empty_metadata(vec![Some("\"tableA\"".into())], vec!["a"]);
479 let schemas = [schema_a];
480 let schemas = schemas.iter().collect::<Vec<_>>();
481
482 let error =
483 normalize_col_with_schemas_and_ambiguity_check(expr, &[&schemas], &[])
484 .unwrap_err()
485 .strip_backtrace();
486 let expected = "Schema error: No field named b. \
487 Valid fields are \"tableA\".a.";
488 assert_eq!(error, expected);
489 }
490
491 #[test]
492 fn unnormalize_cols() {

Callers

nothing calls this directly

Calls 6

strip_backtraceMethod · 0.80
unwrap_errMethod · 0.80
colFunction · 0.50
iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…