You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Krishnanand Khambadkone <kk...@yahoo.com.INVALID> on 2019/01/29 16:21:28 UTC

RepeatedMapHolder

Hi,  Are there any examples of how to use RepeatedMapHolder in a drill custom UDF.  I am sending a kvgen string to a custom udf.

Re: RepeatedMapHolder

Posted by Charles Givre <cg...@gmail.com>.
Hi there, 
Can you please either share your code, or provide us with more details with what you are trying to do with your UDF?
Thanks,
— C

> On Jan 29, 2019, at 11:21, Krishnanand Khambadkone <kk...@yahoo.com.INVALID> wrote:
> 
> Hi,  Are there any examples of how to use RepeatedMapHolder in a drill custom UDF.  I am sending a kvgen string to a custom udf.


Re: RepeatedMapHolder

Posted by Krishnanand Khambadkone <kk...@yahoo.com.INVALID>.
I was able to resolve the issue by using jsonparser in my udf. 

Sent from my iPhone

> On Jan 29, 2019, at 8:22 AM, Charles Givre <cg...@gmail.com> wrote:
> 
>    This message is eligible for Automatic Cleanup! (cgivre@gmail.com) Add cleanup rule | More info 
> Hi there, 
> Can you please either share your code, or provide us with more details with what you are trying to do with your UDF?
> Thanks,
> — C
> 
>> On Jan 29, 2019, at 11:21, Krishnanand Khambadkone <kk...@yahoo.com.INVALID> wrote:
>> 
>> Hi,  Are there any examples of how to use RepeatedMapHolder in a drill custom UDF.  I am sending a kvgen string to a custom udf.
> 

Re: RepeatedMapHolder

Posted by Krishnanand Khambadkone <kk...@yahoo.com.INVALID>.
 Hi Charles,  I have a query that sends  a kvgen output to my UDF called MyUDF  like this,
select  MyUDF(kvgen(convert_fromJSON(max(s.spark_event))['Spark Properties']))
In my UDF java code, I have defined the input parameter thus,

@Param
RepeatedMapHolder input;
How do I dereference this variable,  I am using this line,   It is throwing an exception,

RepeatedMapHolder inputValue  =  org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start, input.end, input.buffer);

    On Tuesday, January 29, 2019, 8:52:16 AM PST, Charles Givre <cg...@gmail.com> wrote:  
 
 This message is eligible for Automatic Cleanup! (cgivre@gmail.com) Add cleanup rule | More info
 Hi there, 
Can you please either share your code, or provide us with more details with what you are trying to do with your UDF?
Thanks,
— C

> On Jan 29, 2019, at 11:21, Krishnanand Khambadkone <kk...@yahoo.com.INVALID> wrote:
> 
> Hi,  Are there any examples of how to use RepeatedMapHolder in a drill custom UDF.  I am sending a kvgen string to a custom udf.
  

Re: RepeatedMapHolder

Posted by Krishnanand Khambadkone <kk...@yahoo.com.INVALID>.
 Hi Charles,  The actual problem i am trying to solve is,  I have a json blob generated by kvgen that contains a bunch of key value pairs like

{"key":"spark.driver.port","value":"18650"}, {"key":"spark.executor.memory","value":"16g"}

I am trying to parse out the value of a particular key say spark.executor.memory   and I want to do this using a custom UDF.
    On Tuesday, January 29, 2019, 8:52:16 AM PST, Charles Givre <cg...@gmail.com> wrote:  
 
 This message is eligible for Automatic Cleanup! (cgivre@gmail.com) Add cleanup rule | More info
 Hi there, 
Can you please either share your code, or provide us with more details with what you are trying to do with your UDF?
Thanks,
— C

> On Jan 29, 2019, at 11:21, Krishnanand Khambadkone <kk...@yahoo.com.INVALID> wrote:
> 
> Hi,  Are there any examples of how to use RepeatedMapHolder in a drill custom UDF.  I am sending a kvgen string to a custom udf.