#29362·polars

Streaming engine occasionally ignores `maintain_order` on right/full joins

Author: kdn36Created Sep 17, 2026Updated Sep 17, 2026
Labelsbugpythonneeds triageA-streaming

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

python
import polars as pl

a = pl.LazyFrame({"ak": [1]})
b = pl.LazyFrame({"bk": [1, 2, 3, 4, 5], "bv": [10, 20, 30, 40, 50]})

q = a.join(b, left_on="ak", right_on="bk", how="right", maintain_order="left_right")

print(q.collect(engine="in-memory"))  # ok
print(q.collect(engine="streaming"))  # sometimes not ok

run as

POLARS_MAX_THREADS=2 python tt.py

Log output

bash
shape: (5, 2)
┌─────┬─────┐
│ bk  ┆ bv  │
│ --- ┆ --- │
│ i64 ┆ i64 │
╞═════╪═════╡
│ 1   ┆ 10  │
│ 2   ┆ 20  │
│ 3   ┆ 30  │
│ 4   ┆ 40  │
│ 5   ┆ 50  │
└─────┴─────┘
shape: (5, 2)
┌─────┬─────┐
│ bk  ┆ bv  │
│ --- ┆ --- │
│ i64 ┆ i64 │
╞═════╪═════╡
│ 1   ┆ 10  │
│ 3   ┆ 30  │
│ 2   ┆ 20  │
│ 5   ┆ 50  │
│ 4   ┆ 40  │
└─────┴─────┘

Issue description

maintain_order not respected in streaming engine

Expected behavior

results match

Installed versions

Reproduces on 1.44.2 and latest main