Skip to content

Commit

Permalink
avoid unnecessary conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Mar 31, 2016
1 parent 8597bba commit 72a5ec0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/pyspark/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ def chain(f, g):


def wrap_udf(f, return_type):
toInternal = return_type.toInternal
return lambda *a: toInternal(f(*a))
if return_type.needConversion():
toInternal = return_type.toInternal
return lambda *a: toInternal(f(*a))
else:
return lambda *a: f(*a)


def read_single_udf(pickleSer, infile):
Expand Down

0 comments on commit 72a5ec0

Please sign in to comment.