drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abdel Hakim Deneche <adene...@maprtech.com>
Subject Re: UDF is not recognized by drill / Validation Error
Date Thu, 19 May 2016 22:33:45 GMT
Hey Julian,

one more thing you could try out: declare the UDF as a static class inside
another class:

public class MyUDF {

   @FunctionTemplate(name = „myaddints", scope = FunctionTemplate.
   FunctionScope.SIMPLE, nulls = FunctionTemplate.NullHandling.NULL_IF_NULL)
   public class IntIntAdd implements DrillSimpleFunc {
      ...
   }

}

Take a look at the following page to see an examples of UDFs:
http://drill.apache.org/docs/custom-function-interfaces/

If this doesn't work check the drillbit log, it should print an error
message when it's starting up if something's wrong with your UDF.

Thanks


On Thu, May 19, 2016 at 3:31 AM, Julian Feinauer <julian.feinauer@web.de>
wrote:

> Dear folks,
>
> I’m currently experimenting with user defined functions in drill but I’m
> not able to get them to work on my drillbits.
> I always get the error: Error: VALIDATION ERROR: From line 1, column 8 to
> line 1, column 41: No match found for function signature myaddints(<ANY>,
> <ANY>).
>
> I already went through all the tips I found in the mailing list.
> The jar contains a drill-module.conf with the content:
> drill.classpath.scanning.packages += "org.julian"
> And the UDF is defined as:
> package org.julian;
>
> import ...
>
> @FunctionTemplate(name = „myaddints", scope =
> FunctionTemplate.FunctionScope.SIMPLE, nulls =
> FunctionTemplate.NullHandling.NULL_IF_NULL)
> public class IntIntAdd implements DrillSimpleFunc {
>
>     @Param
>     IntHolder in1;
>
>     @Param
>     IntHolder in2;
>
>     @Output
>     IntHolder out;
>
>     public void setup() {};
>
>     public void eval() {
>         out.value = in1.value + in2.value;
>     }
>
> }
> I tried to find the bug using the logs and encountered the following
> messages from the drillbit.log:
> Base Configuration:
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-common-1.6.0.jar!/drill-default.conf
>
> Intermediate Configuration and Plugin files, in order of precedence:
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-gis-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-logical-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-kudu-storage-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/3rdparty/drill-memory-base-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-hive-exec-shaded-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-memory-base-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-mongo-storage-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-java-exec-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-common-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-storage-hbase-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-jdbc-storage-1.6.0.jar!/drill-module.conf
>         -
> jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-storage-hive-core-1.6.0.jar!/drill-module.conf
>
> which let’s me think that my jar file (drillUDF-1.0-SNAPSHOT.jar) is not
> scanned altough it is located in jars/3rdparty.
>
> Am I doing something wrong or am I missing something or has anyone a good
> hint for me?
>
> Thank you already!
> Julian




-- 

Abdelhakim Deneche

Software Engineer

  <http://www.mapr.com/>


Now Available - Free Hadoop On-Demand Training
<http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message