{"action":"created","comment":{"url":"https://api.github.com/repos/crate/getting-started/pulls/comments/168114806","pull_request_review_id":96426372,"id":168114806,"diff_hunk":"@@ -0,0 +1,211 @@\n+.. _query-test-data:\n+\n+======================\n+The Basics of Querying\n+======================\n+\n+CrateDB uses `regular SQL`_ for queries.\n+\n+In this document, we show you the basics of how to query CrateDB using SQL.\n+\n+.. _regular SQL: https://crate.io/docs/crate/reference/en/latest/appendices/sql-compliance.html\n+\n+.. NOTE::\n+\n+   This document assumes that you have CrateDB :ref:`installed and\n+   running<install-run>` and that you have :ref:`imported some test data\n+   <import-test-data>`.\n+\n+.. rubric:: Table of Contents\n+\n+.. contents::\n+   :local:\n+\n+Query Your Tweets\n+=================\n+\n+One of the easiest ways to query CrateDB is with the query console in the\n+CrateDB admin UI.\n+\n+:ref:`Open up the admin UI <import-test-data>`.\n+\n+Select the *Console* tab from the left-hand navigation menu.\n+\n+You should see something like this:\n+\n+.. image:: admin-ui-console.png\n+\n+In the previous document, we imported some tweets from the public Twitter\n+timeline.\n+\n+If you want know more about the ``tweets`` table, select the *Tables* tab from\n+the left-hand navigation menu. This screen will show you the table `schema`_.\n+\n+.. _schema: https://crate.io/docs/crate/reference/en/latest/general/ddl/create-table.html#schemas\n+\n+For an example query, why don't we filter those tweets so that we're only\n+looking at tweets from people with more than 100 followers. We can do that with\n+a query like so:\n+\n+.. code-block:: psql\n+\n+    SELECT *\n+      FROM tweets\n+     WHERE account_user['followers_count'] > 100\n+     LIMIT 100;\n+\n+The ``tweets`` table has a column named ``account_user``. The ``account_user``\n+is an `object`_, and can be queried into by specifying object attributes. In\n+the query above, we're matching rows where the ``followers_count`` attribute of\n+this object is more than ``100``.\n+\n+.. _object: https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#object\n+\n+Type this query into the admin UI query console. Then select *EXECUTE QUERY*.\n+\n+You should see something like this:\n+\n+.. image:: admin-ui-results.png\n+\n+CrateDB's SQL support includes distributed `aggregation`_, `scalar`_ functions\n+and `geospatial`_ support for more complex queries and data analysis. CrateDB\n+also comes with `fulltext search`_.\n+\n+.. _aggregation: https://crate.io/docs/stable/sql/aggregation.html\n+.. _scalar: https://crate.io/docs/stable/sql/scalar.html\n+.. _geospatial: https://crate.io/docs/stable/sql/data_types.html#geo-point\n+.. _fulltext search: https://crate.io/docs/crate/reference/en/latest/general/dql/fulltext.html\n+\n+.. SEEALSO::\n+\n+   Consult `the CrateDB query reference`_ for more information.\n+\n+.. _the CrateDB query reference: https://crate.io/docs/crate/reference/en/latest/general/dql/index.html\n+\n+Taking It Further\n+=================\n+\n+Before we take a look at client libraries for CrateDB, let's take a quick look\n+at two additional ways you can query CrateDB.\n+\n+The CrateDB Shell\n+-----------------\n+\n+The CrateDB Shell (aka `Crash`_) is a command-line shell that comes with CrateDB.\n+\n+.. _Crash: https://crate.io/docs/clients/crash/en/latest/\n+\n+Start the shell like so:\n+\n+.. code-block:: sh\n+\n+   sh$ ./bin/crash\n+\n+First let's connect to a running node by typing:\n+\n+.. code-block:: psql\n+\n+    \\connect localhost:4200;","path":"docs/first-use/query.txt","position":108,"original_position":108,"commit_id":"d5fae319c3fab71ccff70b2581efeebd5873e30c","original_commit_id":"d5fae319c3fab71ccff70b2581efeebd5873e30c","user":{"login":"seut","id":219690,"avatar_url":"https://avatars0.githubusercontent.com/u/219690?v=4","gravatar_id":"","url":"https://api.github.com/users/seut","html_url":"https://github.com/seut","followers_url":"https://api.github.com/users/seut/followers","following_url":"https://api.github.com/users/seut/following{/other_user}","gists_url":"https://api.github.com/users/seut/gists{/gist_id}","starred_url":"https://api.github.com/users/seut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seut/subscriptions","organizations_url":"https://api.github.com/users/seut/orgs","repos_url":"https://api.github.com/users/seut/repos","events_url":"https://api.github.com/users/seut/events{/privacy}","received_events_url":"https://api.github.com/users/seut/received_events","type":"User","site_admin":false},"body":"when using crash without any host argument it will directly connect to localhost, so the \\connect wouldn't be necessary. I think we want to highlight here how one could connect inside crash, but not sure if this is relevant for a simple ramp-up guide..","created_at":"2018-02-14T09:22:02Z","updated_at":"2018-02-14T09:27:35Z","html_url":"https://github.com/crate/getting-started/pull/28#discussion_r168114806","pull_request_url":"https://api.github.com/repos/crate/getting-started/pulls/28","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/crate/getting-started/pulls/comments/168114806"},"html":{"href":"https://github.com/crate/getting-started/pull/28#discussion_r168114806"},"pull_request":{"href":"https://api.github.com/repos/crate/getting-started/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/crate/getting-started/pulls/28","id":168126363,"html_url":"https://github.com/crate/getting-started/pull/28","diff_url":"https://github.com/crate/getting-started/pull/28.diff","patch_url":"https://github.com/crate/getting-started/pull/28.patch","issue_url":"https://api.github.com/repos/crate/getting-started/issues/28","number":28,"state":"open","locked":false,"title":"rewrite first use section","user":{"login":"nslater","id":23469,"avatar_url":"https://avatars0.githubusercontent.com/u/23469?v=4","gravatar_id":"","url":"https://api.github.com/users/nslater","html_url":"https://github.com/nslater","followers_url":"https://api.github.com/users/nslater/followers","following_url":"https://api.github.com/users/nslater/following{/other_user}","gists_url":"https://api.github.com/users/nslater/gists{/gist_id}","starred_url":"https://api.github.com/users/nslater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nslater/subscriptions","organizations_url":"https://api.github.com/users/nslater/orgs","repos_url":"https://api.github.com/users/nslater/repos","events_url":"https://api.github.com/users/nslater/events{/privacy}","received_events_url":"https://api.github.com/users/nslater/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-09T00:40:58Z","updated_at":"2018-02-14T09:27:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52e81f07472ff10435607054b317e4a268677e88","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/crate/getting-started/pulls/28/commits","review_comments_url":"https://api.github.com/repos/crate/getting-started/pulls/28/comments","review_comment_url":"https://api.github.com/repos/crate/getting-started/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crate/getting-started/issues/28/comments","statuses_url":"https://api.github.com/repos/crate/getting-started/statuses/d5fae319c3fab71ccff70b2581efeebd5873e30c","head":{"label":"crate:nomi/admin-import","ref":"nomi/admin-import","sha":"d5fae319c3fab71ccff70b2581efeebd5873e30c","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars3.githubusercontent.com/u/4048232?v=4","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":109396044,"name":"getting-started","full_name":"crate/getting-started","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars3.githubusercontent.com/u/4048232?v=4","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/getting-started","description":null,"fork":false,"url":"https://api.github.com/repos/crate/getting-started","forks_url":"https://api.github.com/repos/crate/getting-started/forks","keys_url":"https://api.github.com/repos/crate/getting-started/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/getting-started/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/getting-started/teams","hooks_url":"https://api.github.com/repos/crate/getting-started/hooks","issue_events_url":"https://api.github.com/repos/crate/getting-started/issues/events{/number}","events_url":"https://api.github.com/repos/crate/getting-started/events","assignees_url":"https://api.github.com/repos/crate/getting-started/assignees{/user}","branches_url":"https://api.github.com/repos/crate/getting-started/branches{/branch}","tags_url":"https://api.github.com/repos/crate/getting-started/tags","blobs_url":"https://api.github.com/repos/crate/getting-started/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/getting-started/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/getting-started/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/getting-started/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/getting-started/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/getting-started/languages","stargazers_url":"https://api.github.com/repos/crate/getting-started/stargazers","contributors_url":"https://api.github.com/repos/crate/getting-started/contributors","subscribers_url":"https://api.github.com/repos/crate/getting-started/subscribers","subscription_url":"https://api.github.com/repos/crate/getting-started/subscription","commits_url":"https://api.github.com/repos/crate/getting-started/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/getting-started/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/getting-started/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/getting-started/issues/comments{/number}","contents_url":"https://api.github.com/repos/crate/getting-started/contents/{+path}","compare_url":"https://api.github.com/repos/crate/getting-started/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/getting-started/merges","archive_url":"https://api.github.com/repos/crate/getting-started/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/getting-started/downloads","issues_url":"https://api.github.com/repos/crate/getting-started/issues{/number}","pulls_url":"https://api.github.com/repos/crate/getting-started/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/getting-started/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/getting-started/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/getting-started/labels{/name}","releases_url":"https://api.github.com/repos/crate/getting-started/releases{/id}","deployments_url":"https://api.github.com/repos/crate/getting-started/deployments","created_at":"2017-11-03T13:01:12Z","updated_at":"2017-11-06T21:22:17Z","pushed_at":"2018-02-13T17:02:56Z","git_url":"git://github.com/crate/getting-started.git","ssh_url":"git@github.com:crate/getting-started.git","clone_url":"https://github.com/crate/getting-started.git","svn_url":"https://github.com/crate/getting-started","homepage":null,"size":4095,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"crate:master","ref":"master","sha":"764a1a120abc0c68a94d2043da6b7568498f56bf","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars3.githubusercontent.com/u/4048232?v=4","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":109396044,"name":"getting-started","full_name":"crate/getting-started","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars3.githubusercontent.com/u/4048232?v=4","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/getting-started","description":null,"fork":false,"url":"https://api.github.com/repos/crate/getting-started","forks_url":"https://api.github.com/repos/crate/getting-started/forks","keys_url":"https://api.github.com/repos/crate/getting-started/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/getting-started/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/getting-started/teams","hooks_url":"https://api.github.com/repos/crate/getting-started/hooks","issue_events_url":"https://api.github.com/repos/crate/getting-started/issues/events{/number}","events_url":"https://api.github.com/repos/crate/getting-started/events","assignees_url":"https://api.github.com/repos/crate/getting-started/assignees{/user}","branches_url":"https://api.github.com/repos/crate/getting-started/branches{/branch}","tags_url":"https://api.github.com/repos/crate/getting-started/tags","blobs_url":"https://api.github.com/repos/crate/getting-started/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/getting-started/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/getting-started/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/getting-started/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/getting-started/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/getting-started/languages","stargazers_url":"https://api.github.com/repos/crate/getting-started/stargazers","contributors_url":"https://api.github.com/repos/crate/getting-started/contributors","subscribers_url":"https://api.github.com/repos/crate/getting-started/subscribers","subscription_url":"https://api.github.com/repos/crate/getting-started/subscription","commits_url":"https://api.github.com/repos/crate/getting-started/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/getting-started/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/getting-started/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/getting-started/issues/comments{/number}","contents_url":"https://api.github.com/repos/crate/getting-started/contents/{+path}","compare_url":"https://api.github.com/repos/crate/getting-started/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/getting-started/merges","archive_url":"https://api.github.com/repos/crate/getting-started/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/getting-started/downloads","issues_url":"https://api.github.com/repos/crate/getting-started/issues{/number}","pulls_url":"https://api.github.com/repos/crate/getting-started/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/getting-started/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/getting-started/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/getting-started/labels{/name}","releases_url":"https://api.github.com/repos/crate/getting-started/releases{/id}","deployments_url":"https://api.github.com/repos/crate/getting-started/deployments","created_at":"2017-11-03T13:01:12Z","updated_at":"2017-11-06T21:22:17Z","pushed_at":"2018-02-13T17:02:56Z","git_url":"git://github.com/crate/getting-started.git","ssh_url":"git@github.com:crate/getting-started.git","clone_url":"https://github.com/crate/getting-started.git","svn_url":"https://github.com/crate/getting-started","homepage":null,"size":4095,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crate/getting-started/pulls/28"},"html":{"href":"https://github.com/crate/getting-started/pull/28"},"issue":{"href":"https://api.github.com/repos/crate/getting-started/issues/28"},"comments":{"href":"https://api.github.com/repos/crate/getting-started/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/crate/getting-started/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/crate/getting-started/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crate/getting-started/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/crate/getting-started/statuses/d5fae319c3fab71ccff70b2581efeebd5873e30c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"seut"}}