Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DAC622009F3 for ; Fri, 20 May 2016 20:28:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D955D160A24; Fri, 20 May 2016 18:28:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D3A221609AE for ; Fri, 20 May 2016 20:28:53 +0200 (CEST) Received: (qmail 88549 invoked by uid 500); 20 May 2016 18:28:53 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 88538 invoked by uid 99); 20 May 2016 18:28:52 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2016 18:28:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4435C1A58D0 for ; Fri, 20 May 2016 18:28:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.278 X-Spam-Level: * X-Spam-Status: No, score=1.278 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id k-lUxdfYTNAc for ; Fri, 20 May 2016 18:28:48 +0000 (UTC) Received: from mout.web.de (mout.web.de [212.227.15.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C91485FB5A for ; Fri, 20 May 2016 18:28:47 +0000 (UTC) Received: from julians-imac-2.fritz.box ([46.5.254.5]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MA5dJ-1asalS1sxF-00BKE1 for ; Fri, 20 May 2016 20:28:39 +0200 From: Julian Feinauer Content-Type: multipart/alternative; boundary="Apple-Mail=_9506906B-0AC0-4B47-A464-F6AC22AAFBE3" Message-Id: <1E0C640E-CFB6-4478-ACA8-C1BEF9056B03@web.de> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: UDF is not recognized by drill / Validation Error Date: Fri, 20 May 2016 20:28:38 +0200 References: <7A9EB36A-6E87-4256-8030-AE7B11026B18@web.de> To: dev@drill.apache.org In-Reply-To: X-Mailer: Apple Mail (2.3124) X-Provags-ID: V03:K0:+50JhI8wCzRbNkMs6OAE41lqU2Bb0cwhD3o5lvxyhUl7m7uay8u R7z4D/1KtTDcVB/A4StD4tXCbErYyp88/StLlaxXa3M9JHiucd7CTasOzpGH+lmgVBVjUG8 4SbAYU5NqoRqOxAku94qaZvhPkLAmgnIRzgd4sKrBFmfjHXChSI/b7+i+kfrcAzkfEy+h+m QueiGfNHRMHjLVryTFwkA== X-UI-Out-Filterresults: notjunk:1;V01:K0:hqMVQ4nvOAg=:jEBfYl7SnlLGijuTfL9F1G 7BjMTQLfMquuofslTVXmOMpdZDoOdQ8syXtCjES+urCxQcmNvj20RBnMf5m2MSaCv2AcnNyTG Mh/mO4GooqyRaiZs7rs0iMOqeuyh3w4wMXplQVKwJ/W78zGG0GiE8IForE0qigeYzSpnSNs4r lwi56wbIyAfpaB+CRXzWfIaQ6dANMT2yQQubbUzQ8rBnrcYuPX8A2fSDzi7Bs9Jdgwt8eYAYL ceMN04mHSvxmCWTCndzbRP1YEqo7JVXCJf941zFtmICRktz/AJ5LKNZHJROyXs47zh70Ic0be RHXahqvefyJr4jNzhG2am4dPoB+Cpn+wqV6KqD/JkhOaOZBLvyzobSUodB0Lrz9Lnze5ms7HX b3zv1kjb9ic9bwRgOWJaM0+lXgM3LemYuYQes37qcOlB9nNceyzytZfmxNXl0M5EwHU7XOx+6 qxW1sTDPCu8XKts3V3Lt2W3gu1Kwbug6cmwvBFTwosI7FgaKOhK1PuxfTN33+PfkIIyunyiWh YGxp6oezqaVZdlc1NVRiNEPAlNqi8S2sGuoWffHSOavFb/0E+uUiibhdtZBv1AYlLGpViuKfA C2feDecK9kwOzikmuDad1XyOtzLmeb/6J3z+CYNRPucSNqH+vWqLu9B5FG6ldsGJx4nsR3H0C vvadU2iizo4wPi+fxNrWXNWOjuyrJZb8nbyywlNiIEJCpetHidHECP44sOgcfTfvfSSlvhsFj SELDP0Er2vd5eRo6m5Q3HoBdqLFfGNG6tocGHIGreJo3zvo4lv/6ru8whWzMtRAossaPyR7XF Ymj9Ztv archived-at: Fri, 20 May 2016 18:28:55 -0000 --Apple-Mail=_9506906B-0AC0-4B47-A464-F6AC22AAFBE3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey Abdel, I renamed it due to your previous hint with the static subclass. But the SQL Commands still returns: 0: jdbc:drill:> SELECT myintadd(CAST(position_id AS int),CAST(store_id = AS int)) FROM cp.`employee.json`; Error: VALIDATION ERROR: =46rom line 1, column 8 to line 1, column 63: = No match found for function signature myintadd(, ) So this has to be something wrong with my drill setup? All I do is to start my drillbit with drillbit.sh start (or restart) and = then start drill-conf where the conf/drill-override.conf contains: drill.exec: { cluster-id: "drillbits1", zk.connect: "localhost:2181" } There=E2=80=99s one other thing that seems strange to me with my setup: Although I set the loglevel in conf/logback.xml to trace the = drillbit.log file does not show any trace outputs. Am I doing something wrong with my setup? Thanks Julian > Am 20.05.2016 um 20:13 schrieb Abdel Hakim Deneche = : >=20 > You defined your function as myintadd: >=20 >=20 > @FunctionTemplate(name =3D "*myintadd*", scope ... >=20 >=20 > The following query worked fine for me: >=20 > SELECT *myintadd*(CAST(position_id AS int),CAST(store_id AS int)) FROM >> cp.`employee.json`; >=20 >=20 > Thanks >=20 >=20 >=20 >=20 >=20 > On Fri, May 20, 2016 at 10:17 AM, Julian Feinauer = > wrote: >=20 >> Dear Jacques, >> Dear Abdel, >>=20 >> thanks for your kind help. >>=20 >> jar tf drillUDF-1.0-SNAPSHOT.jar returns: >>=20 >> META-INF/ >> META-INF/MANIFEST.MF >> org/ >> org/apache/ >> org/apache/drill/ >> org/apache/drill/contrib/ >> org/apache/drill/contrib/function/ >> org/julian/ >> drill-module.conf >> IntIntAdd.class >> org/apache/drill/contrib/function/IntIntAdd.class >> org/julian/IntIntAdd$myintadd.class >> org/julian/IntIntAdd.class >> org/julian/IntIntAdd.java >> META-INF/maven/ >> META-INF/maven/julian.test/ >> META-INF/maven/julian.test/drillUDF/ >> META-INF/maven/julian.test/drillUDF/pom.xml >> META-INF/maven/julian.test/drillUDF/pom.properties >>=20 >> And jar tf drillUDF-1.0-SNAPSHOT-sources.jar returns >> META-INF/ >> META-INF/MANIFEST.MF >> org/ >> org/apache/ >> org/apache/drill/ >> org/apache/drill/contrib/ >> org/apache/drill/contrib/function/ >> org/julian/ >> org/julian/IntIntAdd.java >> drill-module.conf >>=20 >> so the drill-module.conf is in both roots. >>=20 >> @Abdel: >> How or where can I share the jar files with you? >>=20 >> Best regards >> Julian >>=20 >>> Am 20.05.2016 um 17:31 schrieb Jacques Nadeau : >>>=20 >>> Can you run jar tf myudf.jar against your jar files? Since Drill is = not >>> detecting the jar file, we need to resolve that first. The >>> drill-module.conf must be in the root of each jar file that should = be >>> included. Lets start by verifying that. >>>=20 >>> -- >>> Jacques Nadeau >>> CTO and Co-Founder, Dremio >>>=20 >>> On Fri, May 20, 2016 at 6:08 AM, Julian Feinauer = >>=20 >>> wrote: >>>=20 >>>> Dear all, >>>>=20 >>>> thank you very much for all your replies. >>>> I tried everything but it is still not working. >>>>=20 >>>> 1. I copy both files (classes and sources) in the /jars/3rdparty >> directory >>>> 2. I restarted the drillbit after this (I use only one drillbit and >>>> drill-conf both running on my local machine) >>>> 3. I changed the class to a static subclass >>>> 4. I have the drill-module.conf in my ressources >>>> 4. The error appears in the drillbit.log as soon as i call the udf >> because >>>> it is not recognized by drill. >>>> On startup drillbit.log states all the packages and jars that are >> scanned >>>> and my custom jar is not listed there. >>>> Therefore I think it is a problem with the class loader or = something >>>> related? >>>>=20 >>>> Could this be possible? >>>>=20 >>>> Greetings >>>> Julian >>>>=20 >>>>> Am 20.05.2016 um 14:36 schrieb Tugdual Grall : >>>>>=20 >>>>> Hi >>>>>=20 >>>>> Be sure you deploy on each nodes, 2 jars: >>>>> - the jar containing the classes >>>>> - the jar contains the sources >>>>>=20 >>>>> The POM.xml in the simple function examples contains the maven >>>>> configuration to generate these 2 files, be sure you have the same = in >>>> your >>>>> project: >>>>>=20 >>>>=20 >> = https://github.com/tgrall/drill-simple-mask-function/blob/master/pom.xml#L= 24-L37 >>>>>=20 >>>>> and you have restarted the drillbit >>>>>=20 >>>>> Regards >>>>> Tug >>>>> @tgrall >>>>>=20 >>>>>=20 >>>>>=20 >>>>> On Fri, May 20, 2016 at 12:34 AM, Abdel Hakim Deneche < >>>> adeneche@maprtech.com >>>>>> wrote: >>>>>=20 >>>>>> the example I gave you was incomplete, here is what I meant to = send: >>>>>>=20 >>>>>> public class MyUDF { >>>>>>=20 >>>>>> @FunctionTemplate(name =3D =E2=80=9Emyaddints", scope =3D = FunctionTemplate. >>>>>> FunctionScope.SIMPLE, nulls =3D >>>>>> FunctionTemplate.NullHandling.NULL_IF_NULL) >>>>>> public *static *class IntIntAdd implements DrillSimpleFunc { >>>>>> ... >>>>>> } >>>>>>=20 >>>>>> } >>>>>>=20 >>>>>>=20 >>>>>> On Thu, May 19, 2016 at 3:33 PM, Abdel Hakim Deneche < >>>>>> adeneche@maprtech.com> >>>>>> wrote: >>>>>>=20 >>>>>>> Hey Julian, >>>>>>>=20 >>>>>>> one more thing you could try out: declare the UDF as a static = class >>>>>> inside >>>>>>> another class: >>>>>>>=20 >>>>>>> public class MyUDF { >>>>>>>=20 >>>>>>> @FunctionTemplate(name =3D =E2=80=9Emyaddints", scope =3D = FunctionTemplate. >>>>>>> FunctionScope.SIMPLE, nulls =3D FunctionTemplate.NullHandling. >>>>>>> NULL_IF_NULL) >>>>>>> public class IntIntAdd implements DrillSimpleFunc { >>>>>>> ... >>>>>>> } >>>>>>>=20 >>>>>>> } >>>>>>>=20 >>>>>>> Take a look at the following page to see an examples of UDFs: >>>>>>> http://drill.apache.org/docs/custom-function-interfaces/ >>>>>>>=20 >>>>>>> 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. >>>>>>>=20 >>>>>>> Thanks >>>>>>>=20 >>>>>>>=20 >>>>>>> On Thu, May 19, 2016 at 3:31 AM, Julian Feinauer < >>>> julian.feinauer@web.de >>>>>>>=20 >>>>>>> wrote: >>>>>>>=20 >>>>>>>> Dear folks, >>>>>>>>=20 >>>>>>>> I=E2=80=99m currently experimenting with user defined functions = in drill but >>>> I=E2=80=99m >>>>>>>> not able to get them to work on my drillbits. >>>>>>>> I always get the error: Error: VALIDATION ERROR: =46rom line 1, >> column 8 >>>>>> to >>>>>>>> line 1, column 41: No match found for function signature >>>>>> myaddints(, >>>>>>>> ). >>>>>>>>=20 >>>>>>>> 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 +=3D "org.julian" >>>>>>>> And the UDF is defined as: >>>>>>>> package org.julian; >>>>>>>>=20 >>>>>>>> import ... >>>>>>>>=20 >>>>>>>> @FunctionTemplate(name =3D =E2=80=9Emyaddints", scope =3D >>>>>>>> FunctionTemplate.FunctionScope.SIMPLE, nulls =3D >>>>>>>> FunctionTemplate.NullHandling.NULL_IF_NULL) >>>>>>>> public class IntIntAdd implements DrillSimpleFunc { >>>>>>>>=20 >>>>>>>> @Param >>>>>>>> IntHolder in1; >>>>>>>>=20 >>>>>>>> @Param >>>>>>>> IntHolder in2; >>>>>>>>=20 >>>>>>>> @Output >>>>>>>> IntHolder out; >>>>>>>>=20 >>>>>>>> public void setup() {}; >>>>>>>>=20 >>>>>>>> public void eval() { >>>>>>>> out.value =3D in1.value + in2.value; >>>>>>>> } >>>>>>>>=20 >>>>>>>> } >>>>>>>> I tried to find the bug using the logs and encountered the = following >>>>>>>> messages from the drillbit.log: >>>>>>>> Base Configuration: >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-common-1.= 6.0.jar!/drill-default.conf >>>>>>>>=20 >>>>>>>> Intermediate Configuration and Plugin files, in order of = precedence: >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-gis-1.6.0= .jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-logical-1= .6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-kudu-stor= age-1.6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/3rdparty/drill-= memory-base-1.6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-hive-exec= -shaded-1.6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-memory-ba= se-1.6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-mongo-sto= rage-1.6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-java-exec= -1.6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-common-1.= 6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-storage-h= base-1.6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-jdbc-stor= age-1.6.0.jar!/drill-module.conf >>>>>>>> - >>>>>>>>=20 >>>>>>=20 >>>>=20 >> = jar:file:/usr/local/Cellar/apache-drill/1.6.0/libexec/jars/drill-storage-h= ive-core-1.6.0.jar!/drill-module.conf >>>>>>>>=20 >>>>>>>> which let=E2=80=99s me think that my jar file = (drillUDF-1.0-SNAPSHOT.jar) is >>>> not >>>>>>>> scanned altough it is located in jars/3rdparty. >>>>>>>>=20 >>>>>>>> Am I doing something wrong or am I missing something or has = anyone a >>>>>> good >>>>>>>> hint for me? >>>>>>>>=20 >>>>>>>> Thank you already! >>>>>>>> Julian >>>>>>>=20 >>>>>>>=20 >>>>>>>=20 >>>>>>>=20 >>>>>>> -- >>>>>>>=20 >>>>>>> Abdelhakim Deneche >>>>>>>=20 >>>>>>> Software Engineer >>>>>>>=20 >>>>>>> >>>>>>>=20 >>>>>>>=20 >>>>>>> Now Available - Free Hadoop On-Demand Training >>>>>>> < >>>>>>=20 >>>>=20 >> = http://www.mapr.com/training?utm_source=3DEmail&utm_medium=3DSignature&utm= _campaign=3DFree%20available >>>>>>>=20 >>>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>> -- >>>>>>=20 >>>>>> Abdelhakim Deneche >>>>>>=20 >>>>>> Software Engineer >>>>>>=20 >>>>>> >>>>>>=20 >>>>>>=20 >>>>>> Now Available - Free Hadoop On-Demand Training >>>>>> < >>>>>>=20 >>>>=20 >> = http://www.mapr.com/training?utm_source=3DEmail&utm_medium=3DSignature&utm= _campaign=3DFree%20available >>>>>>>=20 >>>>>>=20 >>>>=20 >>>>=20 >>=20 >>=20 >=20 >=20 > --=20 >=20 > Abdelhakim Deneche >=20 > Software Engineer >=20 > >=20 >=20 > Now Available - Free Hadoop On-Demand Training > = --Apple-Mail=_9506906B-0AC0-4B47-A464-F6AC22AAFBE3--