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 <sach...@wso2.com> wrote:

> 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
> such as timestamp < now(' ') or it won't work.
>
>
>
>
> On Wed, Jul 29, 2015 at 11:46 AM, Reynold Xin <r...@databricks.com> wrote:
>
>> 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 <swsach...@gmail.com>
>> wrote:
>>
>>> 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
>>>
>>> On Tue, Jul 28, 2015 at 10:18 PM, Reynold Xin <r...@databricks.com>
>>> wrote:
>>>
>>>> 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 <swsach...@gmail.com>
>>>> wrote:
>>>>
>>>>> 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 is there a way to support custom keywords such as "now" which would
>>>>> act as an custom UDF with no parameters.
>>>>>
>>>>>
>>>>> --
>>>>> Thanks,
>>>>> Sachith Withana
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>
>
> --
> Sachith Withana
> Software Engineer; WSO2 Inc.; http://wso2.com
> E-mail: sachith AT wso2.com
> M: +94715518127
> Linked-In: <http://goog_416592669>
> https://lk.linkedin.com/in/sachithwithana
>

Reply via email to