For this tutorial, we’ll assume you’ve already downloaded Apache Druid as described in the single-machine quickstart and have it running on your local machine.
It will also be helpful to have finished and Tutorial: Querying data.
We will ingest the sample data using the following spec, which demonstrates the use of transform specs:
In the transform spec, we have two expression transforms:
super-animal
: prepends “super-“ to the values in theanimal
column. This will override theanimal
column with the transformed version, since the transform’s name isanimal
.
super-animal
values that match “super-mongoose”- values that match 3
This filter selects the first 3 rows, and it will exclude the final “lion” row in the input data. Note that the filter is applied after the transformation.
Let’s submit this task now, which has been included at quickstart/tutorial/transform-index.json
:
The “lion” row has been discarded, the animal
column has been transformed, and we have both the original and transformed column.