{"action":"created","issue":{"url":"https://api.github.com/repos/druid-io/druid/issues/3682","repository_url":"https://api.github.com/repos/druid-io/druid","labels_url":"https://api.github.com/repos/druid-io/druid/issues/3682/labels{/name}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/3682/comments","events_url":"https://api.github.com/repos/druid-io/druid/issues/3682/events","html_url":"https://github.com/druid-io/druid/pull/3682","id":188835746,"number":3682,"title":"[WIP] Built-in SQL","user":{"login":"gianm","id":1214075,"avatar_url":"https://avatars.githubusercontent.com/u/1214075?v=3","gravatar_id":"","url":"https://api.github.com/users/gianm","html_url":"https://github.com/gianm","followers_url":"https://api.github.com/users/gianm/followers","following_url":"https://api.github.com/users/gianm/following{/other_user}","gists_url":"https://api.github.com/users/gianm/gists{/gist_id}","starred_url":"https://api.github.com/users/gianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianm/subscriptions","organizations_url":"https://api.github.com/users/gianm/orgs","repos_url":"https://api.github.com/users/gianm/repos","events_url":"https://api.github.com/users/gianm/events{/privacy}","received_events_url":"https://api.github.com/users/gianm/received_events","type":"User","site_admin":false},"labels":[{"id":182900868,"url":"https://api.github.com/repos/druid-io/druid/labels/Discuss","name":"Discuss","color":"ff00ff","default":false},{"id":17287687,"url":"https://api.github.com/repos/druid-io/druid/labels/Feature","name":"Feature","color":"2ceefb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/druid-io/druid/milestones/21","html_url":"https://github.com/druid-io/druid/milestones/0.9.3","labels_url":"https://api.github.com/repos/druid-io/druid/milestones/21/labels","id":1831000,"number":21,"title":"0.9.3","description":"","creator":{"login":"fjy","id":428325,"avatar_url":"https://avatars.githubusercontent.com/u/428325?v=3","gravatar_id":"","url":"https://api.github.com/users/fjy","html_url":"https://github.com/fjy","followers_url":"https://api.github.com/users/fjy/followers","following_url":"https://api.github.com/users/fjy/following{/other_user}","gists_url":"https://api.github.com/users/fjy/gists{/gist_id}","starred_url":"https://api.github.com/users/fjy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjy/subscriptions","organizations_url":"https://api.github.com/users/fjy/orgs","repos_url":"https://api.github.com/users/fjy/repos","events_url":"https://api.github.com/users/fjy/events{/privacy}","received_events_url":"https://api.github.com/users/fjy/received_events","type":"User","site_admin":false},"open_issues":56,"closed_issues":69,"state":"open","created_at":"2016-06-15T22:35:58Z","updated_at":"2016-11-13T00:42:18Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-11-11T19:46:01Z","updated_at":"2016-11-13T08:46:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/3682","html_url":"https://github.com/druid-io/druid/pull/3682","diff_url":"https://github.com/druid-io/druid/pull/3682.diff","patch_url":"https://github.com/druid-io/druid/pull/3682.patch"},"body":"This is code corresponding to the proposal at: https://groups.google.com/d/msg/druid-development/3npt9Qxpjr0/F-t--qMNBQAJ\r\n\r\nIt includes:\r\n\r\n- Calcite-based parser and planner.\r\n- Documentation in https://github.com/gianm/druid/blob/sql/docs/content/querying/sql.md\r\n- A new DimFilterHavingSpec that was really useful in supporting `GROUP BY ... HAVING` queries.\r\n- A semi-join implementation that is goofy but lovable.\r\n- Metadata support through SegmentMetadataQueries.\r\n- Test suite with lots of test SQLs (including some that are known not to work).\r\n- Some TODOs.\r\n\r\nAlso note that this depends on Calcite master (1.11.0-SNAPSHOT) since we need some bug fixes that haven't been released yet.\r\n\r\nThere's 3 ways of issuing SQL queries, all on the broker:\r\n- JSON API on /druid/v2/sql/\r\n- [Avatica server](https://calcite.apache.org/docs/avatica_overview.html) at /druid/v2/sql/avatica/\r\n- (Not in this branch) A really half baked PostgreSQL-compatible server. The simple query protocol works OK with the command-line psql. The extended query protocol that JDBC and ODBC drivers use needs a lot of work.\r\n\r\nI marked this \"discuss\" since the TODOs aren't done yet and since I think there are some open behavioral questions:\r\n\r\n- Should SQL querying be enabled by default? I think yes, at least for the JSON and Avatica APIs.\r\n- Should background metadata fetching be enabled by default? See DruidSchema.java for how this is done. Basically the broker will issue SegmentMetadataQueries (with a throttle) when it notices new dataSources or new segments. There's a case to be made that even with a throttle, we shouldn't enable this by default (principle of least surprise for upgrading clusters). There's also a case to be made that we should enable it by default, and call out in the release notes how to turn it off (principle of ease of use for new users).\r\n- If background metadata fetching is turned off, what happens when someone issues a SQL query? Do we just fetch it on demand?"},"comment":{"url":"https://api.github.com/repos/druid-io/druid/issues/comments/260173767","html_url":"https://github.com/druid-io/druid/pull/3682#issuecomment-260173767","issue_url":"https://api.github.com/repos/druid-io/druid/issues/3682","id":260173767,"user":{"login":"jihoonson","id":2322288,"avatar_url":"https://avatars.githubusercontent.com/u/2322288?v=3","gravatar_id":"","url":"https://api.github.com/users/jihoonson","html_url":"https://github.com/jihoonson","followers_url":"https://api.github.com/users/jihoonson/followers","following_url":"https://api.github.com/users/jihoonson/following{/other_user}","gists_url":"https://api.github.com/users/jihoonson/gists{/gist_id}","starred_url":"https://api.github.com/users/jihoonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihoonson/subscriptions","organizations_url":"https://api.github.com/users/jihoonson/orgs","repos_url":"https://api.github.com/users/jihoonson/repos","events_url":"https://api.github.com/users/jihoonson/events{/privacy}","received_events_url":"https://api.github.com/users/jihoonson/received_events","type":"User","site_admin":false},"created_at":"2016-11-13T08:46:54Z","updated_at":"2016-11-13T08:46:54Z","body":"Thanks. It works well. "}}
{"actor":{"display_login":"jihoonson"}}