Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 6 additions & 34 deletions docs/tutorials/tutorial-batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ specs by hand or using the _data loader_ built into the web console.

For production environments, it's likely that you'll want to automate data ingestion. This tutorial starts by showing
you how to submit an ingestion spec directly in the web console, and then introduces ways to ingest batch data that
lend themselves to automation—from the command line and from a script.
lend themselves to automation—from the command line.

## Loading data with a spec (via console)

Expand Down Expand Up @@ -116,9 +116,9 @@ This brings up the spec submission dialog where you can paste the spec above.
Once the spec is submitted, wait a few moments for the data to load, after which you can query it.


## Loading data with a spec (via command line)
## Loading data from the command line

To load data with a spec, you need to POST an ingestion task to the Druid Overlord and poll Druid until the data is available for querying.
To load data from the command line, you need to POST an ingestion spec to the Druid Overlord using its task API.

Run the following command from Druid package root:

Expand All @@ -127,41 +127,13 @@ curl -X POST http://localhost:8081/druid/indexer/v1/task \
-H "Content-Type: application/json" \
-d @quickstart/tutorial/wikipedia-index.json
```

You should see output like the following:

```bash
Beginning indexing data for wikipedia
Task started: index_wikipedia_2018-07-27T06:37:44.323Z
Task log: http://localhost:8081/druid/indexer/v1/task/index_wikipedia_2018-07-27T06:37:44.323Z/log
Task status: http://localhost:8081/druid/indexer/v1/task/index_wikipedia_2018-07-27T06:37:44.323Z/status
Task index_wikipedia_2018-07-27T06:37:44.323Z still running...
Task index_wikipedia_2018-07-27T06:37:44.323Z still running...
Task finished with status: SUCCESS
Completed indexing data for wikipedia. Now loading indexed data onto the cluster...
wikipedia loading complete! You may now query your data
```

Once the spec is submitted, you can follow the same instructions as above to wait for the data to load and then query it.


## Loading data without the script

Let's briefly discuss how we would've submitted the ingestion task without using the script. You do not need to run these commands.

To submit the task, POST it to Druid in a new terminal window from the `apache-druid-{{DRUIDVERSION}}` directory:

```bash
curl -X 'POST' -H 'Content-Type:application/json' -d @quickstart/tutorial/wikipedia-index.json http://localhost:8081/druid/indexer/v1/task
```

Which will print the ID of the task if the submission was successful:
If the submission was successful, Druid will print a task ID similar to the following:

```bash
{"task":"index_wikipedia_2018-06-09T21:30:32.802Z"}
{"task":"index_parallel_wikipedia_oiemabcp_2026-07-07T16:05:33.242Z"}
```

You can monitor the status of this task from the console as outlined above.
Wait a few moments for the data to load, then move on to querying it.


## Querying your data
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial-compaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ The Druid distribution includes a compaction task spec to create `DAY` granulari
Note that `segmentGranularity` is set to `DAY` in this compaction task spec.
Submit this task now:
Now, submit this task:
```bash
curl -X POST http://localhost:8081/druid/indexer/v1/task \
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial-delete-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This tutorial requires the following:

In this tutorial, we will use the Wikipedia edits data, with an indexing spec that creates hourly segments. This spec is located at `quickstart/tutorial/deletion-index.json`, and it creates a datasource called `deletion-tutorial`.

Let's load this initial data by calling the Druid Overlord API:
Let's load our initial data by calling the Druid Overlord API:

```bash
curl -X POST http://localhost:8081/druid/indexer/v1/task \
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/tutorial-ingestion-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,15 +580,15 @@ We've finished defining the ingestion spec, it should now look like the followin

## Submit the task and query the data

From the `apache-druid-{{DRUIDVERSION}}` package root, run the following command:
From the `apache-druid-{{DRUIDVERSION}}` package root, run the following command to create a datasource called `ingestion tutorial`:

```bash
curl -X POST http://localhost:8081/druid/indexer/v1/task \
-H "Content-Type: application/json" \
-d @quickstart/tutorial/ingestion-tutorial-index.json
-d @quickstart/ingestion-tutorial-index.json
```

After the script completes, we will query the data.
After the ingestion completes, we will query the data.

In the web console, open a new tab in the **Query** view. Run the following query to view the ingested data:

Expand All @@ -604,4 +604,4 @@ Returns the following:
| `2018-01-01T01:02:00.000Z` | `9000` | `18.1` | `2` | `2.2.2.2` | `7000` | `90` | `6` | `1.1.1.1` | `5000` |
| `2018-01-01T01:03:00.000Z` | `6000` | `4.3` | `1` | `2.2.2.2` | `7000` | `60` | `6` | `1.1.1.1` | `5000` |
| `2018-01-01T02:33:00.000Z` | `30000` | `56.9` | `2` | `8.8.8.8` | `5000` | `300` | `17` | `7.7.7.7` | `4000` |
| `2018-01-01T02:35:00.000Z` | `30000` | `46.3` | `1` | `8.8.8.8` | `5000` | `300` | `17` | `7.7.7.7` | `4000` |
| `2018-01-01T02:35:00.000Z` | `30000` | `46.3` | `1` | `8.8.8.8` | `5000` | `300` | `17` | `7.7.7.7` | `4000` |
Loading