fix quickstart (#13126)
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 250 KiB |
Before Width: | Height: | Size: 245 KiB After Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 150 KiB |
Before Width: | Height: | Size: 203 KiB After Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 290 KiB |
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 108 KiB |
|
@ -184,8 +184,9 @@ Follow these steps to load the sample Wikipedia dataset:
|
|||
```
|
||||
</details>
|
||||
|
||||
6. Optionally, click **Preview** to see the general shape of the data before you ingest it.
|
||||
7. Click **Run** to execute the query. The task may take a minute or two to complete. When done, the task displays its duration and the number of rows inserted into the table. The view is set to automatically refresh, so you don't need to refresh the browser to see the status change.
|
||||
6. Optionally, click **Preview** to see the general shape of the data before you ingest it.
|
||||
7. Edit the first line of the query and change the default destination datasource name from `wikiticker-2015-09-12-sampled` to `wikipedia`.
|
||||
8. Click **Run** to execute the query. The task may take a minute or two to complete. When done, the task displays its duration and the number of rows inserted into the table. The view is set to automatically refresh, so you don't need to refresh the browser to see the status change.
|
||||
|
||||
![Run query](../assets/tutorial-quickstart-04.png "Run query")
|
||||
|
||||
|
@ -201,7 +202,7 @@ In the **Query** view, run the following query to produce a list of top channels
|
|||
SELECT
|
||||
channel,
|
||||
COUNT(*)
|
||||
FROM "wikiticker-2015-09-12-sampled"
|
||||
FROM "wikipedia"
|
||||
GROUP BY channel
|
||||
ORDER BY COUNT(*) DESC
|
||||
```
|
||||
|
@ -214,7 +215,7 @@ Congratulations! You've gone from downloading Druid to querying data with the MS
|
|||
|
||||
See the following topics for more information:
|
||||
|
||||
* [Druid SQL overview](../querying/sql.md) to learn about how to query the data you just ingested.
|
||||
* [Druid SQL overview](../querying/sql.md) or the [Query tutorial](./tutorial-query.md) to learn about how to query the data you just ingested.
|
||||
* [Ingestion overview](../ingestion/index.md) to explore options for ingesting more data.
|
||||
* [Tutorial: Load files using SQL](./tutorial-msq-extern.md) to learn how to generate a SQL query that loads external data into a Druid datasource.
|
||||
* [Tutorial: Load data with native batch ingestion](tutorial-batch-native.md) to load and query data with Druid's native batch ingestion feature.
|
||||
|
|
|
@ -64,21 +64,17 @@ create a query for the page dimension.
|
|||
returns no data, since by default the query filters for data from the last day, while our data is considerably
|
||||
older than that. Let's remove the filter.
|
||||
|
||||
5. In the datasource tree, click `__time` and **Remove Filter**.
|
||||
|
||||
![Clear WHERE filter](../assets/tutorial-query-03.png "Clear WHERE filter")
|
||||
|
||||
6. Click **Run** to run the query.
|
||||
5. Click **Run** to run the query.
|
||||
|
||||
You should now see two columns of data, a page name and the count:
|
||||
|
||||
![Query results](../assets/tutorial-query-04.png "Query results")
|
||||
![Query results](../assets/tutorial-query-03.png "Query results")
|
||||
|
||||
Notice that the results are limited in the console to about a hundred, by default, due to the **Smart query limit**
|
||||
feature. This helps users avoid inadvertently running queries that return an excessive amount of data, possibly
|
||||
overwhelming their system.
|
||||
|
||||
7. Let's edit the query directly and take a look at a few more query building features in the editor.
|
||||
6. Let's edit the query directly and take a look at a few more query building features in the editor.
|
||||
Click in the query edit pane and make the following changes:
|
||||
|
||||
1. Add a line after the first column, `"page"` and Start typing the name of a new column, `"countryName"`. Notice that the autocomplete menu suggests column names, functions, keywords, and more. Choose "countryName" and
|
||||
|
@ -108,7 +104,7 @@ returns the number of edits for the page. Make the same column name change in th
|
|||
is null. Let's
|
||||
show only rows with a `countryName` value.
|
||||
|
||||
8. Click the countryName dimension in the left pane and choose the first filtering option. It's not exactly what we want, but
|
||||
7. Click the `countryName` dimension in the left pane and choose the first filtering option. It's not exactly what we want, but
|
||||
we'll edit it by hand. The new WHERE clause should appear in your query.
|
||||
|
||||
8. Modify the WHERE clause to exclude results that do not have a value for countryName:
|
||||
|
@ -118,7 +114,7 @@ we'll edit it by hand. The new WHERE clause should appear in your query.
|
|||
```
|
||||
Run the query again. You should now see the top edits by country:
|
||||
|
||||
![Finished query](../assets/tutorial-query-035.png "Finished query")
|
||||
![Finished query](../assets/tutorial-query-04.png "Finished query")
|
||||
|
||||
9. Under the covers, every Druid SQL query is translated into a query in the JSON-based _Druid native query_ format before it runs
|
||||
on data nodes. You can view the native query for this query by clicking `...` and **Explain SQL Query**.
|
||||
|
@ -126,7 +122,7 @@ we'll edit it by hand. The new WHERE clause should appear in your query.
|
|||
While you can use Druid SQL for most purposes, familiarity with native query is useful for composing complex queries and for troubleshooting
|
||||
performance issues. For more information, see [Native queries](../querying/querying.md).
|
||||
|
||||
![Explain query](../assets/tutorial-query-06.png "Explain query")
|
||||
![Explain query](../assets/tutorial-query-05.png "Explain query")
|
||||
|
||||
> Another way to view the explain plan is by adding EXPLAIN PLAN FOR to the front of your query, as follows:
|
||||
>
|
||||
|
@ -163,7 +159,7 @@ FROM wikipedia WHERE TIME_IN_INTERVAL("__time", '2015-09-12/2015-09-13')
|
|||
GROUP BY 1
|
||||
```
|
||||
|
||||
![Query example](../assets/tutorial-query-07.png "Query example")
|
||||
![Query example](../assets/tutorial-query-06.png "Query example")
|
||||
|
||||
### General group by
|
||||
|
||||
|
@ -174,7 +170,7 @@ GROUP BY channel, page
|
|||
ORDER BY SUM(added) DESC
|
||||
```
|
||||
|
||||
![Query example](../assets/tutorial-query-08.png "Query example")
|
||||
![Query example](../assets/tutorial-query-07.png "Query example")
|
||||
|
||||
|
||||
## Other ways to invoke SQL queries
|
||||
|
|