Skip to content

Commit

Permalink
Define udf again
Browse files Browse the repository at this point in the history
  • Loading branch information
firestarman committed Oct 10, 2020
1 parent 10bd6d6 commit 900a91d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions integration_tests/src/main/python/udf_cudf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,16 @@ def gpu_run(spark):
'SpecifiedWindowFrame','UnboundedPreceding$', 'UnboundedFollowing$')
@cudf_udf
def test_window(enable_cudf_udf):
@pandas_udf("int")
def _sum_cpu_func(v: pd.Series) -> int:
return v.sum()

@pandas_udf("integer")
def _sum_gpu_func(v: pd.Series) -> int:
import cudf
gpu_series = cudf.Series(v)
return gpu_series.sum()

def cpu_run(spark):
df = _create_df(spark)
w = Window.partitionBy('id').rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)
Expand Down

0 comments on commit 900a91d

Please sign in to comment.