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

Function test_collect_expr

datafusion/expr/src/expr.rs:3943–3962  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3941
3942 #[test]
3943 fn test_collect_expr() -> Result<()> {
3944 // single column
3945 {
3946 let expr = &Expr::Cast(Cast::new(Box::new(col("a")), DataType::Float64));
3947 let columns = expr.column_refs();
3948 assert_eq!(1, columns.len());
3949 assert!(columns.contains(&Column::from_name("a")));
3950 }
3951
3952 // multiple columns
3953 {
3954 let expr = col("a") + col("b") + lit(1);
3955 let columns = expr.column_refs();
3956 assert_eq!(2, columns.len());
3957 assert!(columns.contains(&Column::from_name("a")));
3958 assert!(columns.contains(&Column::from_name("b")));
3959 }
3960
3961 Ok(())
3962 }
3963
3964 #[test]
3965 fn test_logical_ops() {

Callers

nothing calls this directly

Calls 5

CastClass · 0.85
newFunction · 0.85
column_refsMethod · 0.80
colFunction · 0.70
litFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…