Skip to content

Commit 3d6b67c

Browse files
akkapurcgivre
authored andcommitted
DRILL-5956: Add Storage Plugin for Apache Druid
1 parent 1b95c0a commit 3d6b67c

File tree

69 files changed

+4897
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4897
-24
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package org.apache.drill.categories;
20+
21+
/**
22+
* This is a category used to mark unit tests that test the Druid storage plugin.
23+
*/
24+
public interface DruidStorageTest {
25+
}

contrib/native/client/src/protobuf/UserBitShared.pb.cc

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/native/client/src/protobuf/UserBitShared.pb.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<module>storage-kudu</module>
5757
<module>storage-opentsdb</module>
5858
<module>storage-http</module>
59+
<module>storage-druid</module>
5960
</modules>
6061

6162
</project>

contrib/storage-druid/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Drill Apache Druid Plugin
2+
3+
Drill druid storage plugin allows you to perform SQL queries against Druid datasource(s).
4+
This storage plugin is part of [Apache Drill](https://github.com/apache/drill)
5+
6+
### Tested with Druid version
7+
[0.16.0-incubating](https://github.com/apache/incubator-druid/releases/tag/druid-0.16.0-incubating)
8+
9+
### Druid API
10+
11+
Druid supports multiple native queries to address sundry use-cases.
12+
To fetch raw druid rows, druid API support two forms of query, `SELECT` (no relation to SQL) and `SCAN`.
13+
Currently, this plugin uses the [Select](https://druid.apache.org/docs/latest/querying/select-query.html)
14+
query API to fetch raw rows from druid as json.
15+
16+
### Filter Push-Down
17+
18+
Filters pushed down to native druid filter structure, converting SQL where clauses to the respective druid [Filters](https://druid.apache.org/docs/latest/querying/filters.html).
19+
20+
### Plugin Registration
21+
22+
The plugin can be registered in Apache Drill using the drill web interface by navigating to the ```storage``` page.
23+
Following is the default registration configuration.
24+
```json
25+
{
26+
"type" : "druid",
27+
"brokerAddress" : "http://localhost:8082",
28+
"coordinatorAddress": "http://localhost:8081",
29+
"averageRowSizeBytes": 100,
30+
"enabled" : false
31+
}
32+
```
33+
34+
### Druid storage plugin developer notes.
35+
36+
* Building the plugin
37+
38+
`mvn install -pl contrib/storage-druid`
39+
40+
* Building DRILL
41+
42+
`mvn clean install -DskipTests`
43+
44+
* Start Drill In Embedded Mode (mac)
45+
46+
```shell script
47+
distribution/target/apache-drill-1.18.0-SNAPSHOT/apache-drill-1.18.0-SNAPSHOT/bin/drill-embedded
48+
```
49+
50+
* Starting Druid (Docker and Docker Compose required)
51+
```
52+
cd contrib/storage-druid/src/test/resources/druid
53+
docker-compose up -d
54+
```
55+
56+
* There is an `Indexing Task Json` in the same folder as the docker compose file. It can be used to ingest the wikipedia datasource.
57+
58+
* Make sure the druid storage plugin is enabled in Drill.
59+

contrib/storage-druid/pom.xml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
20+
-->
21+
<project xmlns="http://maven.apache.org/POM/4.0.0"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<parent>
25+
<artifactId>drill-contrib-parent</artifactId>
26+
<groupId>org.apache.drill.contrib</groupId>
27+
<version>1.18.0-SNAPSHOT</version>
28+
</parent>
29+
<modelVersion>4.0.0</modelVersion>
30+
31+
<artifactId>drill-druid-storage</artifactId>
32+
<name>contrib/druid-storage-plugin</name>
33+
<properties>
34+
<druid.TestSuite>**/DruidTestSuit.class</druid.TestSuite>
35+
</properties>
36+
<dependencies>
37+
<dependency>
38+
<groupId>org.apache.drill.exec</groupId>
39+
<artifactId>drill-java-exec</artifactId>
40+
<version>${project.version}</version>
41+
</dependency>
42+
43+
<!-- Test dependencies -->
44+
<dependency>
45+
<groupId>org.apache.drill.exec</groupId>
46+
<artifactId>drill-java-exec</artifactId>
47+
<classifier>tests</classifier>
48+
<version>${project.version}</version>
49+
<scope>test</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.apache.drill</groupId>
53+
<artifactId>drill-common</artifactId>
54+
<classifier>tests</classifier>
55+
<version>${project.version}</version>
56+
<scope>test</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.assertj</groupId>
60+
<artifactId>assertj-core</artifactId>
61+
<!-- use 2.9.1 for Java 7 projects -->
62+
<version>3.11.1</version>
63+
<scope>test</scope>
64+
</dependency>
65+
</dependencies>
66+
67+
<build>
68+
<plugins>
69+
<plugin>
70+
<groupId>org.apache.maven.plugins</groupId>
71+
<artifactId>maven-surefire-plugin</artifactId>
72+
<configuration>
73+
<includes>
74+
<include>${druid.TestSuite}</include>
75+
</includes>
76+
<excludes>
77+
<exclude>**/TestDruidQueries.java</exclude>
78+
</excludes>
79+
<systemProperties>
80+
<property>
81+
<name>logback.log.dir</name>
82+
<value>${project.build.directory}/surefire-reports</value>
83+
</property>
84+
</systemProperties>
85+
</configuration>
86+
</plugin>
87+
</plugins>
88+
</build>
89+
</project>

0 commit comments

Comments
 (0)