Result of a window join between tables. Example: >>> import pathway as pw >>> t1 = pw.debug.table_from_markdown( ... ''' ... | t ... 1 | 1 ... 2 | 2 ... 3 | 3 ... 4 | 7 ... 5 | 13 ... ''' ... ) >>> t2 = pw.debug.table_from_
| 22 | |
| 23 | |
| 24 | class WindowJoinResult(DesugaringContext): |
| 25 | """ |
| 26 | Result of a window join between tables. |
| 27 | |
| 28 | Example: |
| 29 | |
| 30 | >>> import pathway as pw |
| 31 | >>> t1 = pw.debug.table_from_markdown( |
| 32 | ... ''' |
| 33 | ... | t |
| 34 | ... 1 | 1 |
| 35 | ... 2 | 2 |
| 36 | ... 3 | 3 |
| 37 | ... 4 | 7 |
| 38 | ... 5 | 13 |
| 39 | ... ''' |
| 40 | ... ) |
| 41 | >>> t2 = pw.debug.table_from_markdown( |
| 42 | ... ''' |
| 43 | ... | t |
| 44 | ... 1 | 2 |
| 45 | ... 2 | 5 |
| 46 | ... 3 | 6 |
| 47 | ... 4 | 7 |
| 48 | ... ''' |
| 49 | ... ) |
| 50 | >>> join_result = t1.window_join_outer(t2, t1.t, t2.t, pw.temporal.tumbling(2)) |
| 51 | >>> isinstance(join_result, pw.temporal.WindowJoinResult) |
| 52 | True |
| 53 | >>> pw.debug.compute_and_print( |
| 54 | ... join_result.select(left_t=t1.t, right_t=t2.t), include_id=False |
| 55 | ... ) |
| 56 | left_t | right_t |
| 57 | | 5 |
| 58 | 1 | |
| 59 | 2 | 2 |
| 60 | 3 | 2 |
| 61 | 7 | 6 |
| 62 | 7 | 7 |
| 63 | 13 | |
| 64 | """ |
| 65 | |
| 66 | _join_result: pw.JoinResult |
| 67 | _table_substitution: dict[pw.TableLike, pw.Table] |
| 68 | _substitution: dict[ThisMetaclass, pw.Joinable] |
| 69 | |
| 70 | def __init__( |
| 71 | self, |
| 72 | join_result: pw.JoinResult, |
| 73 | left_original: pw.Table, |
| 74 | right_original: pw.Table, |
| 75 | left_new: pw.Table, |
| 76 | right_new: pw.Table, |
| 77 | ): |
| 78 | self._join_result = join_result |
| 79 | self._universe = join_result._universe |
| 80 | self._table_substitution = { |
| 81 | left_original: left_new, |