Re: UDF with 2 arguments

2015-11-26 Thread Daniel Lopes
Thanks Davies and Nathan, I found my error. I was using *ArrayType()* and I need to pass de kind of type has in this array and I has not passing *ArrayType(IntegerType())*. Thanks :) On Wed, Nov 25, 2015 at 7:46 PM, Davies Liu wrote: > It works in master (1.6), what's the version of Spark you

Re: UDF with 2 arguments

2015-11-25 Thread Davies Liu
It works in master (1.6), what's the version of Spark you have? >>> from pyspark.sql.functions import udf >>> def f(a, b): pass ... >>> my_udf = udf(f) >>> from pyspark.sql.types import * >>> my_udf = udf(f, IntegerType()) On Wed, Nov 25, 2015 at 12:01 PM, Daniel Lopes wrote: > Hallo, > > supos

UDF with 2 arguments

2015-11-25 Thread Daniel Lopes
Hallo, supose I have function in pyspark that def function(arg1,arg2): pass and udf_function = udf(function, IntegerType()) that takes me error Traceback (most recent call last): File "", line 1, in TypeError: __init__() takes at least 2 arguments (1 given) How I use? Best, -- *Dan