You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by honey francis <ho...@gmail.com> on 2017/05/25 07:41:03 UTC

Drill custome function query

Dear Drill team

I am writing a custom function which receives input from a Parquet file.
The file contains data which is in a JSON format. The custom function
requires a JSON element as input.

For example, I want pass the following JSON element(one of the elements of
the input JSON) to the custom function.

{"Fruits: [{"name":"Apples", "quantity":115},
            {"name":"Oranges","quantity":199},
            {"name":"Peaches", "quantity":116}
           ]
 }

Which holder class should I use in the custom function to read the input?

I tried VarcharHolder, ValueHolder etc. However, it is throwing the
following error.

    Error: Missing function implementation: [myFunction(MAP-REQUIRED)]

Can you please guide in reading the specified input in the custom function.

Thanks and Regards
Honey Francis

Re: Drill custome function query

Posted by Gautam Parai <gp...@mapr.com>.
Hi Honey,


Can you try using the ObjectHolder instead? Please let us know if it resolve the issue.


Gautam

________________________________
From: honey francis <ho...@gmail.com>
Sent: Thursday, May 25, 2017 12:41:03 AM
To: dev@drill.apache.org
Subject: Drill custome function query

Dear Drill team

I am writing a custom function which receives input from a Parquet file.
The file contains data which is in a JSON format. The custom function
requires a JSON element as input.

For example, I want pass the following JSON element(one of the elements of
the input JSON) to the custom function.

{"Fruits: [{"name":"Apples", "quantity":115},
            {"name":"Oranges","quantity":199},
            {"name":"Peaches", "quantity":116}
           ]
 }

Which holder class should I use in the custom function to read the input?

I tried VarcharHolder, ValueHolder etc. However, it is throwing the
following error.

    Error: Missing function implementation: [myFunction(MAP-REQUIRED)]

Can you please guide in reading the specified input in the custom function.

Thanks and Regards
Honey Francis