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

Function test_collect_columns

datafusion/physical-expr/src/utils/mod.rs:602–619  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

600
601 #[test]
602 fn test_collect_columns() -> Result<()> {
603 let expr1 = Arc::new(Column::new("col1", 2)) as _;
604 let mut expected = HashSet::new();
605 expected.insert(Column::new("col1", 2));
606 assert_eq!(collect_columns(&expr1), expected);
607
608 let expr2 = Arc::new(Column::new("col2", 5)) as _;
609 let mut expected = HashSet::new();
610 expected.insert(Column::new("col2", 5));
611 assert_eq!(collect_columns(&expr2), expected);
612
613 let expr3 = Arc::new(BinaryExpr::new(expr1, Operator::Plus, expr2)) as _;
614 let mut expected = HashSet::new();
615 expected.insert(Column::new("col1", 2));
616 expected.insert(Column::new("col2", 5));
617 assert_eq!(collect_columns(&expr3), expected);
618 Ok(())
619 }
620
621 #[test]
622 fn test_collect_predicate_constants_propagates_uniform_literal_value() -> Result<()> {

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…