You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Sandeep Dugar <sd...@gainsight.com> on 2017/02/09 14:51:57 UTC
Drill UDF input - pass variable list of strings
Hi,
I am trying to write a UDF which will whether a list of strings is
contained in another list.
Is there a way to pass a list of values to UDF where the list size is
variable?
Thanks in advance!
-
Regards,
Sandeep
Re: Drill UDF input - pass variable list of strings
Posted by Nitin Pawar <ni...@gmail.com>.
Thanks Charles.
We will give it a try and let you know if it works out
On Fri, Feb 10, 2017 at 12:54 AM, Charles Givre <cg...@gmail.com> wrote:
> Hi Sandeep,
> You might want to look into the ComplexHolder as an option. I haven’t
> tried this, but I’d think that you could specify an input param as a
> ComplexHolder. I’m not sure if this would work or not, but also take a
> look at the implementation of KVGEN().
> I hope this helps,
> - C
>
> > On Feb 9, 2017, at 12:57, Nitin Pawar <ni...@gmail.com> wrote:
> >
> > Jin,
> >
> > we are looking for passing list as input to a function
> > something like function(col1,[1,2,3]), I feel this is doable
> > Just not able to find a way to pass the second parameter as array input
> >
> > On Thu, Feb 9, 2017 at 11:22 PM, Jinfeng Ni <jn...@apache.org> wrote:
> >
> >> AFAIK, Drill currently does not allow variable size of parameters in
> >> UDF in general (built-in function concat is specially handled
> >> internally). Someone once intended to add such support. Looks like
> >> that work has not been completed yet.
> >>
> >>
> >> On Thu, Feb 9, 2017 at 6:51 AM, Sandeep Dugar <sd...@gainsight.com>
> >> wrote:
> >>> Hi,
> >>>
> >>> I am trying to write a UDF which will whether a list of strings is
> >>> contained in another list.
> >>>
> >>> Is there a way to pass a list of values to UDF where the list size is
> >>> variable?
> >>>
> >>> Thanks in advance!
> >>> -
> >>> Regards,
> >>> Sandeep
> >>
> >
> >
> >
> > --
> > Nitin Pawar
>
>
--
Nitin Pawar
Re: Drill UDF input - pass variable list of strings
Posted by Charles Givre <cg...@gmail.com>.
Hi Sandeep,
You might want to look into the ComplexHolder as an option. I haven’t tried this, but I’d think that you could specify an input param as a ComplexHolder. I’m not sure if this would work or not, but also take a look at the implementation of KVGEN().
I hope this helps,
- C
> On Feb 9, 2017, at 12:57, Nitin Pawar <ni...@gmail.com> wrote:
>
> Jin,
>
> we are looking for passing list as input to a function
> something like function(col1,[1,2,3]), I feel this is doable
> Just not able to find a way to pass the second parameter as array input
>
> On Thu, Feb 9, 2017 at 11:22 PM, Jinfeng Ni <jn...@apache.org> wrote:
>
>> AFAIK, Drill currently does not allow variable size of parameters in
>> UDF in general (built-in function concat is specially handled
>> internally). Someone once intended to add such support. Looks like
>> that work has not been completed yet.
>>
>>
>> On Thu, Feb 9, 2017 at 6:51 AM, Sandeep Dugar <sd...@gainsight.com>
>> wrote:
>>> Hi,
>>>
>>> I am trying to write a UDF which will whether a list of strings is
>>> contained in another list.
>>>
>>> Is there a way to pass a list of values to UDF where the list size is
>>> variable?
>>>
>>> Thanks in advance!
>>> -
>>> Regards,
>>> Sandeep
>>
>
>
>
> --
> Nitin Pawar
Re: Drill UDF input - pass variable list of strings
Posted by Nitin Pawar <ni...@gmail.com>.
Jin,
we are looking for passing list as input to a function
something like function(col1,[1,2,3]), I feel this is doable
Just not able to find a way to pass the second parameter as array input
On Thu, Feb 9, 2017 at 11:22 PM, Jinfeng Ni <jn...@apache.org> wrote:
> AFAIK, Drill currently does not allow variable size of parameters in
> UDF in general (built-in function concat is specially handled
> internally). Someone once intended to add such support. Looks like
> that work has not been completed yet.
>
>
> On Thu, Feb 9, 2017 at 6:51 AM, Sandeep Dugar <sd...@gainsight.com>
> wrote:
> > Hi,
> >
> > I am trying to write a UDF which will whether a list of strings is
> > contained in another list.
> >
> > Is there a way to pass a list of values to UDF where the list size is
> > variable?
> >
> > Thanks in advance!
> > -
> > Regards,
> > Sandeep
>
--
Nitin Pawar
Re: Drill UDF input - pass variable list of strings
Posted by Jinfeng Ni <jn...@apache.org>.
AFAIK, Drill currently does not allow variable size of parameters in
UDF in general (built-in function concat is specially handled
internally). Someone once intended to add such support. Looks like
that work has not been completed yet.
On Thu, Feb 9, 2017 at 6:51 AM, Sandeep Dugar <sd...@gainsight.com> wrote:
> Hi,
>
> I am trying to write a UDF which will whether a list of strings is
> contained in another list.
>
> Is there a way to pass a list of values to UDF where the list size is
> variable?
>
> Thanks in advance!
> -
> Regards,
> Sandeep