This example is an entirely self contained example that provides a Fili application for the Druid Wikipedia example.
-
Follow the Druid instructions to bring up a local Druid cluster on your Unix based machine.
-
Clone this repository to your computer.
git clone [email protected]:yahoo/fili.git
-
Use Maven to install and launch the Fili Wikipedia example:
cd fili mvn install mvn -pl fili-wikipedia-example exec:java
From another window, run a test query against the default druid data:
curl "http://localhost:9998/v1/data/wikipedia/hour/?metrics=deleted&dateTime=2015-09-12/PT2H" -H "Content-Type: application/json" | python -m json.tool
If everything is working you should see something like:
{ "rows": [ { "dateTime": "2015-09-12 00:00:00.000", "deleted": 1761.0 }, { "dateTime": "2015-09-12 01:00:00.000", "deleted": 16208.0 } ] }
Here are some sample queries that you can run to verify your server:
-
List tables:
GET http://localhost:9998/v1/tables
-
List dimensions:
GET http://localhost:9998/v1/dimensions
-
List metrics:
GET http://localhost:9998/v1/metrics/
-
Count of edits by hour for the last 72 hours:
GET http://localhost:9998/v1/data/wikipedia/hour/?metrics=count&dateTime=PT72H/current
-
Show debug info, including the query sent to Druid:
GET http://localhost:9998/v1/data/wikipedia/hour/?format=debug&metrics=count&dateTime=PT72H/current
- In IntelliJ, go to
File -> Open
- Select the
pom.xml
file at the root of the project - Run
WikiMain
which can be found infili-wikipedia-example
(e.g. right click and choose run)