MCPcopy Create free account
hub / github.com/apache/arrow / test_dataset_join_collisions

Function test_dataset_join_collisions

python/pyarrow/tests/test_dataset.py:5355–5379  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

5353
5354@pytest.mark.dataset
5355def test_dataset_join_collisions(tempdir):
5356 t1 = pa.table({
5357 "colA": [1, 2, 6],
5358 "colB": [10, 20, 60],
5359 "colVals": ["a", "b", "f"]
5360 })
5361 ds.write_dataset(t1, tempdir / "t1", format="ipc")
5362 ds1 = ds.dataset(tempdir / "t1", format="ipc")
5363
5364 t2 = pa.table({
5365 "colA": [99, 2, 1],
5366 "colB": [99, 20, 10],
5367 "colVals": ["Z", "B", "A"]
5368 })
5369 ds.write_dataset(t2, tempdir / "t2", format="ipc")
5370 ds2 = ds.dataset(tempdir / "t2", format="ipc")
5371
5372 result = ds1.join(ds2, "colA", join_type="full outer", right_suffix="_r")
5373 assert result.to_table().sort_by("colA") == pa.table([
5374 [1, 2, 6, 99],
5375 [10, 20, 60, None],
5376 ["a", "b", "f", None],
5377 [10, 20, None, 99],
5378 ["A", "B", None, "Z"],
5379 ], names=["colA", "colB", "colVals", "colB_r", "colVals_r"])
5380
5381
5382@pytest.mark.dataset

Callers

nothing calls this directly

Calls 2

joinMethod · 0.45
to_tableMethod · 0.45

Tested by

no test coverage detected