()
| 98 | |
| 99 | #[test] |
| 100 | fn case_when() -> Result<()> { |
| 101 | let sql = "SELECT CASE WHEN col_int32 > 0 THEN 1 ELSE 0 END FROM test"; |
| 102 | let plan = test_sql(sql)?; |
| 103 | |
| 104 | assert_snapshot!( |
| 105 | format!("{plan}"), |
| 106 | @r" |
| 107 | Projection: CASE WHEN test.col_int32 > Int32(0) THEN Int64(1) ELSE Int64(0) END AS CASE WHEN test.col_int32 > Int64(0) THEN Int64(1) ELSE Int64(0) END |
| 108 | TableScan: test projection=[col_int32] |
| 109 | " |
| 110 | ); |
| 111 | |
| 112 | let sql = "SELECT CASE WHEN col_uint32 > 0 THEN 1 ELSE 0 END FROM test"; |
| 113 | let plan = test_sql(sql)?; |
| 114 | |
| 115 | assert_snapshot!( |
| 116 | format!("{plan}"), |
| 117 | @r" |
| 118 | Projection: CASE WHEN test.col_uint32 > UInt32(0) THEN Int64(1) ELSE Int64(0) END AS CASE WHEN test.col_uint32 > Int64(0) THEN Int64(1) ELSE Int64(0) END |
| 119 | TableScan: test projection=[col_uint32] |
| 120 | " |
| 121 | ); |
| 122 | Ok(()) |
| 123 | } |
| 124 | |
| 125 | #[test] |
| 126 | fn subquery_filter_with_cast() -> Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…