Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-22 Thread Joseph Swingle
Sure thing. I'll get on it.

Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-22 Thread Charles Givre
t;>> VarCharHolder out; >>>> >>>> @Inject >>>> >>>> DrillBuf buffer; >>>> >>>> HashFunction hashFunction; >>>> >>>> public void setup() { >>>> >>>> hashFunctio

Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-22 Thread Joseph Swingle
ublic void eval() { >> > >> >String stringValue = >> > org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toS >> tringFromUTF8( >> > input.start, input.end, input.buffer); >> > >> >HashCode hashCode = hashFunction.hashString(

Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-20 Thread Charles Givre
tValue = hashCode.toString(); > >        // put the output value in the out buffer > >        out.buffer = buffer; > >        out.start = 0; > >        out.end = outputValue.getBytes().length; > >        buffer.setBytes(0, outputValue.getBytes()); > >    } > >

Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-20 Thread Joseph Swingle
nHelpers. > toStringFromUTF8( > > input.start, input.end, input.buffer); > > > >HashCode hashCode = hashFunction.hashString(stringValue, > > StandardCharsets.UTF_8);//hashFunction.hashString(stringValue); > > > >String outputValue = hashCode.toString(); > >

Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-20 Thread Arina Yelchiyeva
; > > > >HashCode hashCode = hashFunction.hashString(stringValue, > > StandardCharsets.UTF_8);//hashFunction.hashString(stringValue); > > > >String outputValue = hashCode.toString(); > > > >// put the output value in the out buffer > > > >ou

Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-19 Thread Charles Givre
alue.getBytes().length; > >buffer.setBytes(0, outputValue.getBytes()); > >} > > } > > > > On Wed, Nov 9, 2016 at 11:09 AM, Arina Yelchiyeva < > arina.yelchiy...@gmail.com> wrote: > >> Hi Joseph, >> >> custom functions work sh

Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-18 Thread Joseph Swingle
put value in the out buffer out.buffer = buffer; out.start = 0; out.end = outputValue.getBytes().length; buffer.setBytes(0, outputValue.getBytes()); } } On Wed, Nov 9, 2016 at 11:09 AM, Arina Yelchiyeva < arina.yelchiy...@gmail.com> wrote: > Hi

Re: Need help with UDF/Custom Functions (DRILL-4776)

2016-11-09 Thread Arina Yelchiyeva
Hi Joseph, custom functions work should work fine in 1.8. At least I am not aware of any issues. Can you specify what problems with custom UDFs do you have? Kind regards Arina On Wed, Nov 9, 2016 at 6:02 PM, Joseph Swingle wrote: > Drill team, > > Are Custom Functions simply broke i

Need help with UDF/Custom Functions (DRILL-4776)

2016-11-09 Thread Joseph Swingle
Drill team, Are Custom Functions simply broke in Version 1.8? Any movement on DRILL-4776 would be appreciated. Heck, willing to even fix all the doc, provided someone can provide me a Custom Function that works in 1.8. https://issues.apache.org/jira/browse/DRILL-4776

Re: Custom Functions

2015-07-06 Thread Alok Tanna
Hey Ted, so I hit the end road. I figured out the compilation issues but then now I am getting run time issues when I am trying to open a jdbc connection from within the UDF. I have made some modification to your simpleAdd UDF. Attached is the src code of the file . The example is very silly - just

Re: Custom Functions

2015-07-01 Thread Ted Dunning
yes. You can do this. It doesn't make sense to do so, but you can. This might not be a good example for playing with UDF's since it is going to get you some confusing answers. On Wed, Jul 1, 2015 at 12:15 PM, Alok Tanna wrote: > I am trying to look further into UDF, write more complex UDF u

Re: Custom Functions

2015-07-01 Thread Jason Altekruse
If the general idea of what you are trying to accomplish with this function is not private, it might be useful to ask about your use case more generally. Although we are still working to integrate the JDBC plugin into the Drill mainline and it still requires a thorough testing cycle, this might be

Re: Custom Functions

2015-07-01 Thread Jim Scott
A UDF is just code, so you are going to make it do pretty much anything you want. What is advisable is different than what is capable. A function that requires a database to work is a tough one though. You would have to bake in special functionality or hard code to find the configuration to connec

Re: Custom Functions

2015-07-01 Thread Alok Tanna
I am trying to look further into UDF, write more complex UDF using which we call out a JDBC source in UDF . Thanks, Alok Tanna --- On Wed, Jul 1, 2015 at 11:30 AM, Jim Scott wrote: > I am curious to understand the reason you want a UDF to call out to a JDBC > source. > > You can call a JDBC so

Re: Custom Functions

2015-07-01 Thread Jim Scott
I am curious to understand the reason you want a UDF to call out to a JDBC source. You can call a JDBC source directly from within Drill which makes it so that you can query a JDBC source and join it to other sources just like the DFS. On Wed, Jul 1, 2015 at 9:58 AM, Alok Tanna wrote: > Ted\ V

Re: Custom Functions

2015-07-01 Thread Alok Tanna
Ted\ Vince, Can you help me with below quick question related to UDF . 1. Can I call a jdbc from within a UDF ? 2. Can we have JDBC UDF work with embedded Drill Install without cluster mode & zookeeper . referring to https://github.com/vicenteg/DrillJDBCExample/blob/master/src/main/java/com/mapr/d

Re: Custom Functions

2015-06-29 Thread Ted Dunning
Thanks. Very interesting input. On Mon, Jun 29, 2015 at 2:09 PM, Alok Tanna wrote: > Maven 3.3.3 -- Latest version , it worked with 3.0.5 > > On Mon, Jun 29, 2015 at 4:23 PM, Ted Dunning > wrote: > > > On Mon, Jun 29, 2015 at 1:03 PM, Alok Tanna > > wrote: > > > > > I was using latest version

Re: Custom Functions

2015-06-29 Thread Alok Tanna
Maven 3.3.3 -- Latest version , it worked with 3.0.5 On Mon, Jun 29, 2015 at 4:23 PM, Ted Dunning wrote: > On Mon, Jun 29, 2015 at 1:03 PM, Alok Tanna > wrote: > > > I was using latest version of Maven , guess that > > was the issue. > > > > What was the version? >

Re: Custom Functions

2015-06-29 Thread Ted Dunning
On Mon, Jun 29, 2015 at 1:03 PM, Alok Tanna wrote: > I was using latest version of Maven , guess that > was the issue. > What was the version?

Re: Custom Functions

2015-06-29 Thread Alok Tanna
> > > > > > > Try using the JDK. > > > > > > > > Also, here's a POM: > > > > https://github.com/vicenteg/DrillJDBCExample/blob/master/pom.xml > > > > > > > > On Wed, Jun 24, 2015 at 2:10 PM, Alok Tanna > > > > > wro

Re: Custom Functions

2015-06-25 Thread Ted Dunning
provided in this environment. Perhaps you are > > > > running on a JRE rather than a JDK? > > > > [INFO] 1 error > > > > [INFO] - > > > > [INFO] > > > >

Re: Custom Functions

2015-06-25 Thread Alok Tanna
compile) on project simple-drill-function: Compilation failure > > > [ERROR] No compiler is provided in this environment. Perhaps you are > > > running on a JRE rather than a JDK? > > > [ERROR] -> [Help 1] > > > [ERROR] > > > [ERROR] To see

Re: Custom Functions

2015-06-25 Thread Abdel Hakim Deneche
; (default-compile) on project simple-drill-function: Compilation >> failure >> > > [ERROR] No compiler is provided in this environment. Perhaps you are >> > > running on a JRE rather than a JDK? >> > > [ERROR] -> [Help 1] >> > >

Re: Custom Functions

2015-06-25 Thread Alok Tanna
ven-compiler-plugin:3.0:compile > > > (default-compile) on project simple-drill-function: Compilation failure > > > [ERROR] No compiler is provided in this environment. Perhaps you are > > > running on a JRE rather than a JDK? > > > [ERROR] -> [Help 1] > >

Re: Custom Functions

2015-06-24 Thread Ted Dunning
;> one of the arguments as well. > > >> >> > > >> >> The issues with this approach are: > > >> >> > > >> >> 1) kinda ugly because you aren't calling your code directly > > >> >> > > >> >> 2) Jython isn't quite Python > > >> >> > > >> >> I have no idea how to do it specifically, but it is plausible that > > you > > >> >> could build something that automatically generates the interlude > > >> function > > >> >> for you in Java that calls your Python code. Python annotations > might > > >> be > > >> >> the cat's pajamas for this. Or not. Hard to say. > > >> >> > > >> >> The Java API that Drill provides is not a traditional API in the > > normal > > >> >> sense of the word because Drill actually snarfs the source code and > > >> >> inlines > > >> >> it into Drill-generated code. It wouldn't understand your Python > > code > > >> at > > >> >> all. > > >> >> > > >> >> It might be possible to teach Drill how to understand how to > > transform > > >> >> Python UDF's directly into something that Drill could use, but that > > >> would > > >> >> definitely be a bit ambitious. > > >> >> > > >> >> How utterly clean an interface do you need? > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> On Tue, Jun 23, 2015 at 10:10 PM, Alok Tanna < > > ata...@exertdigital.com> > > >> >> wrote: > > >> >> > > >> >> > Can we create Custom Functions using Python in Drill ? > > >> >> > > > >> >> > I do understand Drill provides a high performance Java API with > > >> >> interfaces > > >> >> > so that we can implement to develop simple and aggregate custom > > >> >> functions. > > >> >> > > > >> >> > Thanks, > > >> >> > Alok Tanna > > >> >> > > > >> >> > > >> > > > >> > > > >> > > > > > > > > >

Re: Custom Functions

2015-06-24 Thread Ted Dunning
enerates the interlude > > > function > > > >> for you in Java that calls your Python code. Python annotations > might > > be > > > >> the cat's pajamas for this. Or not. Hard to say. > > > >> > > > >> The Java API that Drill provides is not a traditional API in the > > normal > > > >> sense of the word because Drill actually snarfs the source code and > > > >> inlines > > > >> it into Drill-generated code. It wouldn't understand your Python > code > > > at > > > >> all. > > > >> > > > >> It might be possible to teach Drill how to understand how to > transform > > > >> Python UDF's directly into something that Drill could use, but that > > > would > > > >> definitely be a bit ambitious. > > > >> > > > >> How utterly clean an interface do you need? > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> On Tue, Jun 23, 2015 at 10:10 PM, Alok Tanna < > ata...@exertdigital.com > > > > > > >> wrote: > > > >> > > > >> > Can we create Custom Functions using Python in Drill ? > > > >> > > > > >> > I do understand Drill provides a high performance Java API with > > > >> interfaces > > > >> > so that we can implement to develop simple and aggregate custom > > > >> functions. > > > >> > > > > >> > Thanks, > > > >> > Alok Tanna > > > >> > > > > >> > > > > > > > > > > > > > >

Re: Custom Functions

2015-06-24 Thread Vince Gonzalez
ven using the -X switch to enable full debug logging. > > > Thanks, > Alok Tanna > > -- Forwarded message -- > From: Alok Tanna > Date: Wed, Jun 24, 2015 at 1:16 PM > Subject: Re: Custom Functions > To: user@drill.apache.org > > > Vince, If possible ca

Re: Custom Functions

2015-06-24 Thread Alok Tanna
bug logging. Thanks, Alok Tanna -- Forwarded message -- From: Alok Tanna Date: Wed, Jun 24, 2015 at 1:16 PM Subject: Re: Custom Functions To: user@drill.apache.org Vince, If possible can you share your POM.xml file . On Wed, Jun 24, 2015 at 1:16 PM, Alok Tanna wrote: > Vin

Re: Custom Functions

2015-06-24 Thread Alok Tanna
gt;> inlines > >> it into Drill-generated code. It wouldn't understand your Python code > at > >> all. > >> > >> It might be possible to teach Drill how to understand how to transform > >> Python UDF's directly into something that Drill could use, but that > would > >> definitely be a bit ambitious. > >> > >> How utterly clean an interface do you need? > >> > >> > >> > >> > >> > >> > >> On Tue, Jun 23, 2015 at 10:10 PM, Alok Tanna > >> wrote: > >> > >> > Can we create Custom Functions using Python in Drill ? > >> > > >> > I do understand Drill provides a high performance Java API with > >> interfaces > >> > so that we can implement to develop simple and aggregate custom > >> functions. > >> > > >> > Thanks, > >> > Alok Tanna > >> > > >> > > > > >

Re: Custom Functions

2015-06-24 Thread Alok Tanna
rates the interlude > > function > > >> for you in Java that calls your Python code. Python annotations might > be > > >> the cat's pajamas for this. Or not. Hard to say. > > >> > > >> The Java API that Drill provides is not a traditional API in

Re: Custom Functions

2015-06-24 Thread Ted Dunning
d because Drill actually snarfs the source code and > >> inlines > >> it into Drill-generated code. It wouldn't understand your Python code > at > >> all. > >> > >> It might be possible to teach Drill how to understand how to transform

Re: Custom Functions

2015-06-24 Thread Vince Gonzalez
ble to teach Drill how to understand how to transform >> Python UDF's directly into something that Drill could use, but that would >> definitely be a bit ambitious. >> >> How utterly clean an interface do you need? >> >> >> >> >> >> >> On Tue, Jun 23, 2015 at 10:10 PM, Alok Tanna >> wrote: >> >> > Can we create Custom Functions using Python in Drill ? >> > >> > I do understand Drill provides a high performance Java API with >> interfaces >> > so that we can implement to develop simple and aggregate custom >> functions. >> > >> > Thanks, >> > Alok Tanna >> > >> > >

Re: Custom Functions

2015-06-24 Thread Alok Tanna
w to understand how to transform > Python UDF's directly into something that Drill could use, but that would > definitely be a bit ambitious. > > How utterly clean an interface do you need? > > > > > > > On Tue, Jun 23, 2015 at 10:10 PM, Alok Tanna > wrote:

Re: Custom Functions

2015-06-23 Thread Ted Dunning
to transform Python UDF's directly into something that Drill could use, but that would definitely be a bit ambitious. How utterly clean an interface do you need? On Tue, Jun 23, 2015 at 10:10 PM, Alok Tanna wrote: > Can we create Custom Functions using Python in Drill ? > > I d

Custom Functions

2015-06-23 Thread Alok Tanna
Can we create Custom Functions using Python in Drill ? I do understand Drill provides a high performance Java API with interfaces so that we can implement to develop simple and aggregate custom functions. -- Thanks & Regards, Alok R. Tanna

Custom Functions

2015-06-23 Thread Alok Tanna
Can we create Custom Functions using Python in Drill ? I do understand Drill provides a high performance Java API with interfaces so that we can implement to develop simple and aggregate custom functions. Thanks, Alok Tanna

Re: How to create drill custom functions when 3rd party libraries are needed?

2015-03-18 Thread Haofeng Tang
. > > > On Sun, Mar 15, 2015 at 3:07 PM, Haofeng Tang wrote: > > > I was able to follow the custom function articles to create new > functions. > > > > However, when I tried to create my own test custom functions, where some > > 3rd party libraries are needed, I

Re: How to create drill custom functions when 3rd party libraries are needed?

2015-03-15 Thread Jacques Nadeau
to follow the custom function articles to create new functions. > > However, when I tried to create my own test custom functions, where some > 3rd party libraries are needed, I wasn't able to get it to work. Here's my > test: > > -- Created class "MyClass"

How to create drill custom functions when 3rd party libraries are needed?

2015-03-15 Thread Haofeng Tang
I was able to follow the custom function articles to create new functions. However, when I tried to create my own test custom functions, where some 3rd party libraries are needed, I wasn't able to get it to work. Here's my test: -- Created class "MyClass" in drill-java-