Re: Drill custom function on HBase

2015-07-19 Thread Aditya
All the scalar fields coming out of HBase are of VARBIARY type and hence input type (field Param) will be passed in a VarBinaryHolder. Please take a look at similar function implementations[1] which decode primitive types encoded using HBase OrderedBytes encoding. [1] https://reviews.apache.org/r

Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi, I'm trying to deploy a UDF that I have written according to the documentation. I have also: 1. Copied the jar file to jars/3rdparty 2. Changed the config "conf/drill-override.conf" to include: drill.logical.function.package += ["org.apache.drill.exec.expr.fn.impl","com.activi

Re: Drill not picking up a UDF

2015-07-19 Thread Jim Bates
Did you include a file drill-module.conf in your jar along with source files? On Jul 19, 2015 12:20 PM, "Stefán Baxter" wrote: > Hi, > > I'm trying to deploy a UDF that I have written according to the > documentation. > > I have also: > >1. Copied the jar file >to jars/3rdparty > >2.

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
NO! Thank you , will do that right now :) On Sun, Jul 19, 2015 at 5:38 PM, Jim Bates wrote: > Did you include a file drill-module.conf in your jar along with source > files? > On Jul 19, 2015 12:20 PM, "Stefán Baxter" > wrote: > > > Hi, > > > > I'm trying to deploy a UDF that I have written ac

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi Jim, Now I have added the file to the jar (both root and resources folder) but that does not seem to change anything. Any additional ideas? Regards, -Stefan On Sun, Jul 19, 2015 at 5:40 PM, Stefán Baxter wrote: > NO! > > Thank you , will do that right now :) > > On Sun, Jul 19, 2015 at 5:

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi again, Going over the documentation once more I came across this: - Add the sources and classes JAR files to Drill’s classpath. I'm only including a standard .jar (with classes no sources) and I wonder why this dependency is listed. Anyways, that it the next step. A sample .jar that work

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi, Building it using the maven-source-plugin (source:jar) and copying that .jar file over to "drill/jar/3rdparty" changes nothing :(. The .jar file now includes the empty drill-module.conf missing earlier. This is all getting a tiny bit frustrating and any additional assistance is welcomed :).

Re: Drill not picking up a UDF

2015-07-19 Thread Jim Bates
Maven will typically create a jar for class and a jar for source when told to do so. I just include the source files in the same jar as the class files. There is a github example drill udf project we are working on to include several examples to simplify the learning curve. If your interested... I'

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi Jim, My UDF is currently so simple that I'm not sure you need it (or want it). It basically just rounds a timestamp value with ISO 8601 periods asRoundTimestamp(timestampvalue,'PT10M'). I would be more than happy to contribute to your project rather than building our own :). Is the repo publ

Re: Drill not picking up a UDF

2015-07-19 Thread Ted Dunning
Sounds like a fine example, not because of sophistication but because it deals with dates. Check the drill logs. It is likely that drill is grumpy about something in your udf or packaging. Also, feel free to snitch the pom from the simple examples in order to get the pieces assembled and

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi Jim, I'm still not able to make this work. Do you have a sample .jar file with a small example that you are running? Regards, -Stefan On Sun, Jul 19, 2015 at 6:46 PM, Ted Dunning wrote: > > Sounds like a fine example, not because of sophistication but because it > deals with dates. > > Che

Re: Drill not picking up a UDF

2015-07-19 Thread Jim Bates
give me a few min and I'll post one. On Sun, Jul 19, 2015 at 4:14 PM, Stefán Baxter wrote: > Hi Jim, > > I'm still not able to make this work. Do you have a sample .jar file with a > small example that you are running? > > Regards, > -Stefan > > On Sun, Jul 19, 2015 at 6:46 PM, Ted Dunning > w

Re: Drill not picking up a UDF

2015-07-19 Thread Ted Dunning
Stefan, Have you seen this github project: https://github.com/mapr-demos/simple-drill-functions ? On Sun, Jul 19, 2015 at 2:14 PM, Stefán Baxter wrote: > Hi Jim, > > I'm still not able to make this work. Do you have a sample .jar file with a > small example that you are running? > > Regards,

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi Ted, I fetched this, built it and deployed it without problems. I can not see any real difference other than this deploys two .jar (I tried that as well earlier). I'm still trying to figure out why Drill is not picking up my UDFs Regards, -Stefán On Sun, Jul 19, 2015 at 10:45 PM, Ted Dunnin

Re: Drill not picking up a UDF

2015-07-19 Thread Tugdual Grall
Hi Stefan, Do you think you can share your complete project ? This will help to debug it for you. T On Sunday, July 19, 2015, Stefán Baxter wrote: > Hi Ted, > > I fetched this, built it and deployed it without problems. > I can not see any real difference other than this deploys two .jar (I t

Re: Drill not picking up a UDF

2015-07-19 Thread Jim Bates
Stefán, in the logs/drillbit.log file, are there any complaints before it gives you the number of loaded functions? INFO o.a.d.e.e.f.FunctionImplementationRegistry - Function registry loaded. 2372 functions loaded in 5214 ms On Sun, Jul 19, 2015 at 6:20 PM, Stefán Baxter wrote: > Hi Ted, > >

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi, I'm more than happy to share the little that is there (I will publish it on github and send link tomorrow). I ended up copying my UDF (singl-file.java) into the simple-drill-function project where it got picked up. Then I discovered a whole new set of dependencies/limitations - The UDF a

Re: Drill not picking up a UDF

2015-07-19 Thread Stefán Baxter
Hi, The project can be found here: https://github.com/acmeguy/asdrill Thank you, -Stefán On Sun, Jul 19, 2015 at 11:57 PM, Stefán Baxter wrote: > Hi, > > I'm more than happy to share the little that is there (I will publish it > on github and send link tomorrow). > > I ended up copying my UDF

Re: Drill not picking up a UDF

2015-07-19 Thread Jim Bates
I pulled out your udf class and threw it into my package. It worked for me with a few modifications. You can not have imported classes or method references in your eval or setup methods as the code will get pulled out and executed somewhere else and it won't be able to find it. With that in mind,

Re: VALUES operator in FROM clause

2015-07-19 Thread Daniel Barclay
And if you want lots of (boringly identical) rows: WITH x AS ( SELECT * FROM ( VALUES 1,1,1,1,1,1,1,1,1,1 ) AS MyTable( key ) ) SELECT COUNT(*) FROM x AS x1 INNER JOIN x AS x2 on x2.key = x1.key INNER JOIN x AS x3 on x3.key = x2.key INNER JOIN x AS x4 on x4.key = x3.key INNER JOIN x AS x5 on x5

Re: Drill not picking up a UDF

2015-07-19 Thread Ted Dunning
On Sun, Jul 19, 2015 at 4:57 PM, Stefán Baxter wrote: > Perhaps this was mentioned in the documentation but this is, at the very > least, not straight forward and super-inviting. > You are very correct on this. The purpose of the simple drill function is as a start at making some of these obscu