Re: Custom UDFs with zero parameters support

2015-07-28 Thread Sachith Withana
Sure. Will do. Thanks a lot for the help. On Wed, Jul 29, 2015 at 12:08 PM, Reynold Xin wrote: > BTW for 1.5, there is already a now like function being added, so it > should work out of the box in 1.5.0, to be released end of Aug/early Sep. > > > On Tue, Jul 28, 2015 at 11:38 PM, Reynold Xin

Re: Custom UDFs with zero parameters support

2015-07-28 Thread Reynold Xin
Yup - would you be willing to submit a patch to add UDF0? Should be pretty easy (really just add a new Java class, and then add a new function to registerUDF) On Tue, Jul 28, 2015 at 11:36 PM, Sachith Withana wrote: > That's what I'm doing right now. > I'm implementing UDF1 for the now() UDF a

Re: Custom UDFs with zero parameters support

2015-07-28 Thread Reynold Xin
BTW for 1.5, there is already a now like function being added, so it should work out of the box in 1.5.0, to be released end of Aug/early Sep. On Tue, Jul 28, 2015 at 11:38 PM, Reynold Xin wrote: > Yup - would you be willing to submit a patch to add UDF0? > > Should be pretty easy (really just

Re: Custom UDFs with zero parameters support

2015-07-28 Thread Sachith Withana
That's what I'm doing right now. I'm implementing UDF1 for the now() UDF and in the UDF registration I'm registering UDFs with zero parameters as a UDF1s. For the above example, although I add the now() UDF as is, since it's registered as an UDF1, I need to provide an empty parameter in the query

Re: Custom UDFs with zero parameters support

2015-07-28 Thread Reynold Xin
We should add UDF0 to it. For now, can you just create an one-arg UDF and don't use the argument? On Tue, Jul 28, 2015 at 10:59 PM, Sachith Withana wrote: > Hi Reynold, > > I'm implementing the interfaces given here ( > https://github.com/apache/spark/tree/master/sql/core/src/main/java/org/apa

Re: Custom UDFs with zero parameters support

2015-07-28 Thread Sachith Withana
Hi Reynold, I'm implementing the interfaces given here ( https://github.com/apache/spark/tree/master/sql/core/src/main/java/org/apache/spark/sql/api/java ). But currently there is no UDF0 adapter. Any suggestions? I'm new to Spark and any help would be appreciated. -- Thanks, Sachith Withana O

Re: Custom UDFs with zero parameters support

2015-07-28 Thread Reynold Xin
I think we do support 0 arg UDFs: https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/functions.scala#L2165 How are you using UDFs? On Tue, Jul 28, 2015 at 2:15 AM, Sachith Withana wrote: > Hi all, > > Currently I need to support custom UDFs with sparkSQL q

Custom UDFs with zero parameters support

2015-07-28 Thread Sachith Withana
Hi all, Currently I need to support custom UDFs with sparkSQL queries which have no parameters. ex: now() : which returns the current time in milliseconds. Spark currently have support for UDFs having 1 or more parameters but does not contain a UDF0 Adaptor. Is there a way to implement this? Or