{"record":{"id":"7788afe72ddf1d22","repo":"pathwaycom/pathway","slug":"cannot-join-table-with-itself-use-table-copy-7788af","errorCode":null,"errorMessage":"Cannot join table with itself. Use <table>.copy() as one of the arguments of the join.","messagePattern":"Cannot join table with itself\\. Use <table>\\.copy\\(\\) as one of the arguments of the join\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/stdlib/temporal/_interval_join.py","lineNumber":203,"sourceCode":"        *on: pw.ColumnExpression,\n        behavior: CommonBehavior | None = None,\n        mode: pw.JoinMode,\n        left_instance: pw.ColumnReference | None = None,\n        right_instance: pw.ColumnReference | None = None,\n    ) -> IntervalJoinResult:\n        \"\"\"Creates an IntervalJoinResult. To perform an interval join uses it uses two\n        tumbling windows of size `lower_bound` + `upper_bound` and then filters the result.\n        \"\"\"\n        check_joint_types(\n            {\n                \"self_time_expression\": (left_time_expression, TimeEventType),\n                \"other_time_expression\": (right_time_expression, TimeEventType),\n                \"lower_bound\": (interval.lower_bound, IntervalType),\n                \"upper_bound\": (interval.upper_bound, IntervalType),\n            }\n        )\n        if left == right:\n            raise ValueError(\n                \"Cannot join table with itself. Use <table>.copy() as one of the arguments of the join.\"\n            )\n        if interval.lower_bound > interval.upper_bound:  # type: ignore[operator]\n            raise ValueError(\n                \"lower_bound has to be less than or equal to the upper_bound in the Table.interval_join().\"\n            )\n\n        if interval.lower_bound == interval.upper_bound:\n            cls: type[IntervalJoinResult] = _ZeroDifferenceIntervalJoinResult\n        else:\n            cls = _NonZeroDifferenceIntervalJoinResult\n        return cls._interval_join(\n            left,\n            right,\n            left_time_expression,\n            right_time_expression,\n            interval,\n            *on,","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/stdlib/temporal/_interval_join.py#L185-L221","documentation":"Error \"Cannot join table with itself. Use <table>.copy() as one of the arguments of the join.\" thrown in pathwaycom/pathway.","triggerScenarios":"Thrown at python/pathway/stdlib/temporal/_interval_join.py:203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use <table>.copy() as one of the join arguments when you need to join a table with itself."],"exampleFix":"t.interval_join(t.copy(), ...)","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}