Bob Corsaro
Cc: Salih Oztop ; user
Sent: Monday, June 29, 2015 9:52 PM
Subject: Re: SparkSQL built in functions
Interesting. Looking at the definitions, sql.functions.pow is defined only for
(col,col). Just as an experiment, create a column with value 2 and see if that
works.Cheers
-TypeError
>> Traceback (most recent call
>> last) in ()> 1 df.select("name",
>> (df.age)**2).show()
>> TypeError: unsupported operand type(s) for ** or pow(): 'Column' and 'int'
>>
>
)> 1 df.select("name",
> (df.age)**2).show()
> TypeError: unsupported operand type(s) for ** or pow(): 'Column' and 'int'
>
>
> Moreover testing the functions individually they are working fine.
>
> pow(2,4)
>
> 16
>
> 2**4
>
lect("name", (df.age)**2).show()
TypeError: unsupported operand type(s) for ** or pow(): 'Column' and 'int'
Moreover testing the functions individually they are working fine.pow(2,4)
162**4
16
Kind Regards
Salih Oztop
From: Bob Corsaro
To: user
Sent: Monday, June
I'm having trouble using "select pow(col) from table" It seems the function
is not registered for SparkSQL. Is this on purpose or an oversight? I'm
using pyspark.