CUSTOM
JAVA UDA IMPLEMENTATION IN APACHE DRILL
The
following software is to be installed.
- Ubuntu 13.10
- Java 1.7
- Maven 3.0.4
- Git
- Eclipse Kepler with Maven Plugins
- Apache Drill 0.7.0 (Installed in an embedded mode)
Download
and build the source code of Apache Drill 0.7.0 and 0.8.0 from git.
- Apache Drill 0.8.0
- git clone https://github.com/apache/drill.gitmvn clean install
- Apache Drill 0.7.0
- git clone -b 0.7.0 https://github.com/apache/drill.gitmvn clean install
- Open Eclipse and Right click on Package Explorer and select Import.
- Navigate to Maven and select Existing Maven Projects to Import the compiled source code of Drill 0.7.0
- In case of any error in project, fix the errors.
- Create a new Maven project (e.g., groupID - com.udf, artifactID - udf, version - 0.0.1-SNAPSHOT and package - jar)
- Add the following lines in pom.xml file.
- <dependencyManagement><dependencies><dependency><groupId>org.apache.drill.exec</groupId><artifactId>drill-java-exec</artifactId><version>${project.version}</version></dependency></dependencies></dependencyManagement>
<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><version>2.4</version><executions><execution><id>attach-sources</id><!-- <phase>verify</phase> --><goals><goal>jar</goal></goals></execution></executions></plugin></plugins></build>
- Create a Java class and develop your UDA
- To Clean - Right click on your Maven project and select Run as -> Maven Clean
- Goto Project in Eclipse and select clean
- To compile and build Jar - Right click on your Maven project and select Run as -> Maven Install.
- Now the jar file would be available in target folder under your project.
- Stop the drillbit service
- Copy the jar files (yourprojectname-0.0.1-SNAPSHOT-sources.jar and yourprojectname-0.0.1-SNAPSHOT.jar) from the target directory of your project and paste to $DRILL_HOME/jars/classb/ location.
- Start the drillbit service.
- Make sure that your jar is loaded successfully into the Drill by verifying the drill log files.
- Open web ui of apache drill (http://localhost:8047/)
- Navigate to Query and execute your custom query.