From 0a9a90803140f67cbf6dee02f06476d18022904f Mon Sep 17 00:00:00 2001 From: jacobtolar Date: Mon, 22 Nov 2021 07:35:05 -0600 Subject: [PATCH] Add inline native query example to tutorial (#11642) * Add inline native query example to tutorial Minor change to the tutorial that adds an example of a native HTTP query request body, and adds a link to the more detailed "native query over HTTP" documentation. * cleanup * Apply suggestions from code review. Co-authored-by: sthetland Co-authored-by: sthetland --- docs/tutorials/tutorial-query.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/tutorial-query.md b/docs/tutorials/tutorial-query.md index 19461ac8219..d4762704030 100644 --- a/docs/tutorials/tutorial-query.md +++ b/docs/tutorials/tutorial-query.md @@ -216,7 +216,13 @@ Retrieved 10 rows in 0.06s. ### Query SQL over HTTP -You can submit queries directly to the Druid Broker over HTTP. +You can submit native queries [directly to the Druid Broker over HTTP](../querying/sql.md#http-post). The request body should be a JSON object, with the value for the key `query` containing text of the query: + +```json +{ + "query": "SELECT page, COUNT(*) AS Edits FROM wikipedia WHERE \"__time\" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00' GROUP BY page ORDER BY Edits DESC LIMIT 10" +} +``` The tutorial package includes an example file that contains the SQL query shown above at `quickstart/tutorial/wikipedia-top-pages-sql.json`. Let's submit that query to the Druid Broker: