Drill is written in Java, so all of the current format plugins are written against java APIs. The JNI is the Java Native Interface, which allows a java program to call out to compiled native code and pass data between them. If you have access to the source of this tool and could make it write to a buffer instead of standard out this should be able to be passed to the java code in your format plugin.
Not sure about the performance, but if you want to avoid messing around with the JNI, Java can call external processes, and it appears from this stackoverflow answer collect the output of such a call. This should able able to be fed into the Drill CSV parser without too much work. http://stackoverflow.com/questions/9126142/output-the-result-of-a-bash-script - Jason On Tue, Mar 8, 2016 at 8:44 AM, Wilburn, Scott < [email protected]> wrote: > The compiled tool I use to read the files today is written in C. It > converts the files to ASCII CSV and prints to STDOUT. Would that work in a > format plugin? > > Thanks, > Scott Wilburn > > > -----Original Message----- > From: Jason Altekruse [mailto:[email protected]] > Sent: Tuesday, March 08, 2016 08:31 AM > To: user > Subject: [E] Re: binary file searching > > Not quite sure what you mean by "compiled tool". I'm guessing the most > efficient way to accomplish something like this would be to write a format > plugin that would call out to this external code and then read the result > with the Drill CSV reader. Is this external tool written in Java or another > language like Scala that compiles to JVM bytecode? We currently don't > include any code with the Drill server that crosses the JNI boundary to run > a native binary executable, but it should be possible. > > On Tue, Mar 8, 2016 at 8:16 AM, Wilburn, Scott < > [email protected]> wrote: > > > Hello, > > Is there a way to use Drill to search through binary files? I have > > some binary files that require a special compiled tool to convert into > > CSV format. Can Drill execute an external tool to convert each file > > into ASCII before searching? > > > > Thanks, > > Scott Wilburn > > > > >
