MCPcopy Index your code
hub / github.com/pathwaycom/pathway / join_inner

Function join_inner

python/pathway/internals/joins.py:1241–1304  ·  view source on GitHub ↗

Inner-joins two tables or join results. Args: left: the left side of the join, ``Table`` or ``JoinResult``. right: the right side of the join, ``Table`` or ``JoinResult``. on: a list of column expressions. Each must have == as the top level operation and b

(
    left: Joinable,
    right: Joinable,
    *on: expr.ColumnExpression,
    id: expr.ColumnReference | None = None,
    left_instance: expr.ColumnReference | None = None,
    right_instance: expr.ColumnReference | None = None,
    left_exactly_once: bool = False,
    right_exactly_once: bool = False,
)

Source from the content-addressed store, hash-verified

1239
1240
1241def join_inner(
1242 left: Joinable,
1243 right: Joinable,
1244 *on: expr.ColumnExpression,
1245 id: expr.ColumnReference | None = None,
1246 left_instance: expr.ColumnReference | None = None,
1247 right_instance: expr.ColumnReference | None = None,
1248 left_exactly_once: bool = False,
1249 right_exactly_once: bool = False,
1250) -> JoinResult:
1251 """Inner-joins two tables or join results.
1252
1253 Args:
1254 left: the left side of the join, ``Table`` or ``JoinResult``.
1255 right: the right side of the join, ``Table`` or ``JoinResult``.
1256 on: a list of column expressions. Each must have == as the top level operation
1257 and be of the form LHS: ColumnReference == RHS: ColumnReference.
1258 id: optional argument for id of result, can be only self.id or other.id
1259 left_instance/right_instance: optional arguments describing partitioning of the data into
1260 separate instances
1261 left_exactly_once: if you can guarantee that each row on the left side of the join will be
1262 joined at most once, then you can set this parameter to ``True``. Then each row after
1263 getting a match is removed from the join state. As a result, less memory is needed.
1264 Works only for append-only tables.
1265 right_exactly_once: if you can guarantee that each row on the right side of the join will be
1266 joined at most once, then you can set this parameter to ``True``. Then each row after
1267 getting a match is removed from the join state. As a result, less memory is needed.
1268 Works only for append-only tables.
1269
1270 Returns:
1271 JoinResult: an object on which `.select()` may be called to extract relevant
1272 columns from the result of the join.
1273
1274 Example:
1275
1276 >>> import pathway as pw
1277 >>> t1 = pw.debug.table_from_markdown('''
1278 ... age | owner | pet
1279 ... 10 | Alice | 1
1280 ... 9 | Bob | 1
1281 ... 8 | Alice | 2
1282 ... ''')
1283 >>> t2 = pw.debug.table_from_markdown('''
1284 ... age | owner | pet | size
1285 ... 10 | Alice | 3 | M
1286 ... 9 | Bob | 1 | L
1287 ... 8 | Tom | 1 | XL
1288 ... ''')
1289 >>> t3 = pw.join_inner(t1, t2, t1.pet == t2.pet, t1.owner == t2.owner).select(
1290 ... age=t1.age, owner_name=t2.owner, size=t2.size
1291 ... )
1292 >>> pw.debug.compute_and_print(t3, include_id = False)
1293 age | owner_name | size
1294 9 | Bob | L
1295 """
1296 return left.join_inner(
1297 right,
1298 *on,

Callers

nothing calls this directly

Calls 1

join_innerMethod · 0.80

Tested by

no test coverage detected