| 183 | # as opposed to test 2, column t1_A2 can be computed out of columns of t1 |
| 184 | # as such, it should be filled, even if there was no match |
| 185 | def test_left_join_03(): |
| 186 | t1 = T( |
| 187 | """ |
| 188 | | a | b |
| 189 | 1 | 11 | 111 |
| 190 | 2 | 12 | 112 |
| 191 | 3 | 13 | 113 |
| 192 | 4 | 14 | 114 |
| 193 | """ |
| 194 | ) |
| 195 | |
| 196 | t2 = T( |
| 197 | """ |
| 198 | | c | d |
| 199 | 1 | 11 | 211 |
| 200 | 2 | 12 | 212 |
| 201 | 3 | 13 | 213 |
| 202 | 4 | 13 | 214 |
| 203 | """ |
| 204 | ) |
| 205 | |
| 206 | expected = T( |
| 207 | """ |
| 208 | a | t1_a2 | s |
| 209 | 11 | 121 | 322 |
| 210 | 12 | 144 | 324 |
| 211 | 13 | 169 | 326 |
| 212 | 13 | 169 | 327 |
| 213 | 14 | 196 | |
| 214 | """ |
| 215 | ) |
| 216 | |
| 217 | res = t1.join_left(t2, t1.a == t2.c).select( |
| 218 | t1.a, |
| 219 | t1_a2=t1.a * t1.a, |
| 220 | s=pw.require(t1.b + t2.d, t2.id), |
| 221 | ) |
| 222 | assert_table_equality_wo_index(res, expected) |
| 223 | |
| 224 | |
| 225 | def test_right_join_01(): |