| 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<()> { |