surekhasaharan commented on a change in pull request #6126: New quickstart and tutorials URL: https://github.com/apache/incubator-druid/pull/6126#discussion_r209114320
########## File path: docs/content/tutorials/tutorial-update-data.md ########## @@ -0,0 +1,150 @@ +--- +layout: doc_page +--- + +# Tutorial: Updating existing data + +This tutorial demonstrates how to update existing data, showing both overwrites and appends. + +For this tutorial, we'll assume you've already downloaded Druid as described in +the [single-machine quickstart](index.html) and have it running on your local machine. + +It will also be helpful to have finished [Tutorial: Loading a file](/docs/VERSION/tutorials/tutorial-batch.html), [Tutorial: Querying data](/docs/VERSION/tutorials/tutorial-query.html), and [Tutorial: Rollup](/docs/VERSION/tutorials/tutorial-rollup.html). + +## Overwrite + +This section of the tutorial will cover how to overwrite an existing interval of data. + +### Load initial data + +Let's load an initial data set which we will overwrite and append to. + +The spec we'll use for this tutorial is located at `quickstart/tutorial/updates-init-index.json`. This spec creates a datasource called `updates-tutorial` from the `quickstart/tutorial/updates-data.json` input file. + +Let's submit that task: + +``` +bin/post-index-task --file quickstart/tutorial/updates-init-index.json +``` + +We have three initial rows containing an "animal" dimension and "number" metric: + +``` +dsql> select * from "updates-tutorial"; +┌──────────────────────────┬──────────┬───────┬────────┐ +│ __time │ animal │ count │ number │ +├──────────────────────────┼──────────┼───────┼────────┤ +│ 2018-01-01T01:01:00.000Z │ tiger │ 1 │ 100 │ +│ 2018-01-01T03:01:00.000Z │ aardvark │ 1 │ 42 │ Review comment: hmm, unusual animal names, I had to lookup `aardvark` :) ```The aardvark is a medium-sized, burrowing, nocturnal mammal native to Africa. It is the only living species of the order Tubulidentata, although other prehistoric species and genera of Tubulidentata are known``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org