Skip to content

Commit

Permalink
feat(pyspark): add ArrayMap operation
Browse files Browse the repository at this point in the history
  • Loading branch information
tokoko authored and cpcloud committed Mar 26, 2023
1 parent 2b1301e commit e2c159c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ibis/backends/pyspark/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,15 @@ def compile_array_filter(t, op, **kwargs):
)


@compiles(ops.ArrayMap)
def compile_array_map(t, op, **kwargs):
src_column = t.translate(op.arg, **kwargs)
return F.transform(
src_column,
lambda x: t.translate(op.result, arg_columns={op.parameter: x}, **kwargs),
)


# --------------------------- Null Operations -----------------------------


Expand Down
1 change: 0 additions & 1 deletion ibis/backends/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ def test_array_slice(con, start, stop):
"mssql",
"polars",
"postgres",
"pyspark",
"snowflake",
"sqlite",
],
Expand Down

0 comments on commit e2c159c

Please sign in to comment.