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

Function test_table_join_many_columns

python/pyarrow/tests/test_table.py:3290–3325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3288
3289@pytest.mark.acero
3290def test_table_join_many_columns():
3291 t1 = pa.table({
3292 "colA": [1, 2, 6],
3293 "col2": ["a", "b", "f"]
3294 })
3295
3296 t2 = pa.table({
3297 "colB": [99, 2, 1],
3298 "col3": ["Z", "B", "A"],
3299 "col4": ["Z", "B", "A"],
3300 "col5": ["Z", "B", "A"],
3301 "col6": ["Z", "B", "A"],
3302 "col7": ["Z", "B", "A"]
3303 })
3304
3305 result = t1.join(t2, "colA", "colB")
3306 assert result.combine_chunks() == pa.table({
3307 "colA": [1, 2, 6],
3308 "col2": ["a", "b", "f"],
3309 "col3": ["A", "B", None],
3310 "col4": ["A", "B", None],
3311 "col5": ["A", "B", None],
3312 "col6": ["A", "B", None],
3313 "col7": ["A", "B", None]
3314 })
3315
3316 result = t1.join(t2, "colA", "colB", join_type="full outer")
3317 assert result.combine_chunks().sort_by("colA") == pa.table({
3318 "colA": [1, 2, 6, 99],
3319 "col2": ["a", "b", "f", None],
3320 "col3": ["A", "B", None, "Z"],
3321 "col4": ["A", "B", None, "Z"],
3322 "col5": ["A", "B", None, "Z"],
3323 "col6": ["A", "B", None, "Z"],
3324 "col7": ["A", "B", None, "Z"],
3325 })
3326
3327
3328@pytest.mark.dataset

Callers

nothing calls this directly

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected