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 trying to see if we can access a jdbc resultset from within the UDF - so don't pay much attention to the actual logic.
I am using Drill 1.0.0 in embedded mode. I remember you were going to rewrite few things on UDF side, so wanted to check if the latest version 1.1.0 has improvements on how we can write UDF with jdbc connections . Below are the Run time Errors : org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: java.lang.RuntimeException: JSR/RET are not supported with computeFrames option Fragment 0:0 [Error Id: 248a7f90-b64d-4e3d-8fa7-26cffeeb3d1a on 10.0.0.68:31010] at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:522) ~[drill-common-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.work.fragment.FragmentExecutor.sendFinalState(FragmentExecutor.java:324) [drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.work.fragment.FragmentExecutor.cleanup(FragmentExecutor.java:180) [drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:293) [drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38) [drill-common-1.0.0-rebuffed.jar:1.0.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79] Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: JSR/RET are not supported with computeFrames option at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2263) ~[guava-14.0.1.jar:na] at com.google.common.cache.LocalCache.get(LocalCache.java:4000) ~[guava-14.0.1.jar:na] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4004) ~[guava-14.0.1.jar:na] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4874) ~[guava-14.0.1.jar:na] at org.apache.drill.exec.compile.CodeCompiler.getImplementationClass(CodeCompiler.java:65) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.compile.CodeCompiler.getImplementationClass(CodeCompiler.java:58) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.ops.FragmentContext.getImplementationClass(FragmentContext.java:299) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.setupNewSchema(ProjectRecordBatch.java:442) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:78) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:129) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:146) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:105) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:95) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:51) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.innerNext(LimitRecordBatch.java:115) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:146) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:105) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:95) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:51) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.innerNext(RemovingRecordBatch.java:92) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:146) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:83) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:80) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:73) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:259) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:253) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_79] at javax.security.auth.Subject.doAs(Subject.java:415) ~[na:1.7.0_79] at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1556) ~[hadoop-common-2.4.1.jar:na] at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:253) [drill-java-exec-1.0.0-rebuffed.jar:1.0.0] ... 4 common frames omitted Caused by: java.lang.RuntimeException: JSR/RET are not supported with computeFrames option at org.objectweb.asm.Frame.execute(Frame.java:1178) ~[asm-debug-all-5.0.3.jar:5.0.3] at org.objectweb.asm.MethodWriter.visitJumpInsn(MethodWriter.java:984) ~[asm-debug-all-5.0.3.jar:5.0.3] at org.objectweb.asm.tree.JumpInsnNode.accept(JumpInsnNode.java:88) ~[asm-debug-all-5.0.3.jar:5.0.3] at org.objectweb.asm.tree.InsnList.accept(InsnList.java:162) ~[asm-debug-all-5.0.3.jar:5.0.3] at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:816) ~[asm-debug-all-5.0.3.jar:5.0.3] at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:726) ~[asm-debug-all-5.0.3.jar:5.0.3] at org.objectweb.asm.tree.ClassNode.accept(ClassNode.java:412) ~[asm-debug-all-5.0.3.jar:5.0.3] at org.apache.drill.exec.compile.AsmUtil.isClassOk(AsmUtil.java:53) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.compile.ClassTransformer.getImplementationClass(ClassTransformer.java:233) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.compile.CodeCompiler$Loader.load(CodeCompiler.java:80) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at org.apache.drill.exec.compile.CodeCompiler$Loader.load(CodeCompiler.java:76) ~[drill-java-exec-1.0.0-rebuffed.jar:1.0.0] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599) ~[guava-14.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379) ~[guava-14.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342) ~[guava-14.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257) ~[guava-14.0.1.jar:na] ... 33 common frames omitted Thanks, Alok Tanna On Wed, Jul 1, 2015 at 9:43 PM, Ted Dunning <[email protected]> wrote: > 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 <[email protected]> > wrote: > > > 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 <[email protected]> wrote: > > > > > 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 <[email protected]> > > > wrote: > > > > > > > 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/drill/DrillJDBCExample.java > > > > > > > > Thanks, > > > > Alok Tanna > > > > > > > > > > > > On Mon, Jun 29, 2015 at 6:00 PM, Ted Dunning <[email protected]> > > > > wrote: > > > > > > > > > Thanks. Very interesting input. > > > > > > > > > > On Mon, Jun 29, 2015 at 2:09 PM, Alok Tanna < > [email protected] > > > > > > > > wrote: > > > > > > > > > > > Maven 3.3.3 -- Latest version , it worked with 3.0.5 > > > > > > > > > > > > On Mon, Jun 29, 2015 at 4:23 PM, Ted Dunning < > > [email protected]> > > > > > > wrote: > > > > > > > > > > > > > On Mon, Jun 29, 2015 at 1:03 PM, Alok Tanna < > > > [email protected] > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > I was using latest version of Maven , guess that > > > > > > > > was the issue. > > > > > > > > > > > > > > > > > > > > > > What was the version? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > *Jim Scott* > > > Director, Enterprise Strategy & Architecture > > > +1 (347) 746-9281 > > > > > > <http://www.mapr.com/> > > > [image: MapR Technologies] <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 > > > > > > > > > >
