(self)
| 176 | ) |
| 177 | |
| 178 | def test_join(self): |
| 179 | expr_src = parse_one("SELECT a, b FROM t1 LEFT JOIN t2 ON t1.key = t2.key") |
| 180 | expr_tgt = parse_one("SELECT a, b FROM t1 RIGHT JOIN t2 ON t1.key = t2.key") |
| 181 | |
| 182 | src_join = expr_src.find(exp.Join) |
| 183 | tgt_join = expr_tgt.find(exp.Join) |
| 184 | |
| 185 | self._validate_delta_only( |
| 186 | diff_delta_only(expr_src, expr_tgt), |
| 187 | [ |
| 188 | Remove(expression=src_join), |
| 189 | Insert(expression=tgt_join), |
| 190 | Move(source=exp.to_table("t2"), target=exp.to_table("t2")), |
| 191 | Move(source=src_join.args["on"], target=tgt_join.args["on"]), |
| 192 | ], |
| 193 | ) |
| 194 | |
| 195 | expr_src = parse_one("SELECT a.x FROM a INNER JOIN b ON a.x = b.y LEFT JOIN c ON a.p = c.q") |
| 196 | expr_tgt = parse_one("SELECT a.x FROM a inner JOIN b ON a.x = b.y left JOIN c ON a.p = c.q") |
| 197 | |
| 198 | self._validate_delta_only(diff_delta_only(expr_src, expr_tgt), []) |
| 199 | |
| 200 | def test_window_functions(self): |
| 201 | expr_src = parse_one("SELECT ROW_NUMBER() OVER (PARTITION BY a ORDER BY b)") |
nothing calls this directly
no test coverage detected