Skip to content

Commit 41d8cc2

Browse files
committed
feat(DRAFT): Add acero union wrapper
1 parent 6d219f4 commit 41d8cc2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

narwhals/_plan/arrow/acero.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@ def prepend_column(native: pa.Table, name: str, values: IntoExpr) -> Decl:
246246
return _add_column(native, 0, name, values)
247247

248248

249+
def _union(declarations: Iterable[Decl], /) -> Decl:
250+
"""[`union`] merges multiple data streams with the same schema into one, similar to a `SQL UNION ALL` clause.
251+
252+
[`union`]: https://arrow.apache.org/docs/cpp/acero/user_guide.html#union
253+
"""
254+
decls: Incomplete = declarations
255+
return Decl("union", pac.ExecNodeOptions(), decls)
256+
257+
249258
def _order_by(
250259
sort_keys: Iterable[tuple[str, Order]] = (),
251260
*,

0 commit comments

Comments
 (0)