Adding Custom Functions to Drill
After you develop your custom function and generate the sources and classes JAR files, add both JAR files to the Drill classpath, and include the name of the package that contains the classes to the main Drill configuration file. Restart the Drillbit on each node to refresh the configuration.
To add a custom function to Drill, complete the following steps:
- Add the sources JAR file and the classes JAR file for the custom function to the Drill classpath on all nodes running a Drillbit. To add the JAR files, copy them to
<drill installation directory>/jars/3rdparty. - Your class jar file should contain a
drill-module.conffile at its root. The
drill-module.conffile should contain the packages to scan for functionsdrill.classpath.scanning.package+=. Separate package names with a comma.Example
drill.classpath.scanning.package+= "com.mydomain.drill.fn"On each Drill node in the cluster, navigate to the Drill installation directory, and issue the following command to restart the Drillbit:
<drill installation directory>/bin/drillbit.sh restartNow you can issue queries with your custom functions to Drill.
