{"action":"created","comment":{"url":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments/203749322","pull_request_review_id":138699845,"id":203749322,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzc0OTMyMg==","diff_hunk":"@@ -200,6 +200,14 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(\n \n         auto interpreter = InterpreterFactory::get(ast, context, stage);\n         res = interpreter->execute();\n+        if (InterpreterInsertQuery * insertInterpreter = typeid_cast<InterpreterInsertQuery *>(&*interpreter))\n+        {\n+            String database;\n+            String table_name;\n+            insertInterpreter->getDatabaseTable(database, table_name);\n+            if (!database.empty())\n+                context.setCurrentTable(database, table_name);","path":"dbms/src/Interpreters/executeQuery.cpp","position":10,"original_position":10,"commit_id":"b87a66b0e38d6a56220c70de82ccb5c6c4332be2","original_commit_id":"b87a66b0e38d6a56220c70de82ccb5c6c4332be2","user":{"login":"4ertus2","id":8061274,"node_id":"MDQ6VXNlcjgwNjEyNzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/8061274?v=4","gravatar_id":"","url":"https://api.github.com/users/4ertus2","html_url":"https://github.com/4ertus2","followers_url":"https://api.github.com/users/4ertus2/followers","following_url":"https://api.github.com/users/4ertus2/following{/other_user}","gists_url":"https://api.github.com/users/4ertus2/gists{/gist_id}","starred_url":"https://api.github.com/users/4ertus2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4ertus2/subscriptions","organizations_url":"https://api.github.com/users/4ertus2/orgs","repos_url":"https://api.github.com/users/4ertus2/repos","events_url":"https://api.github.com/users/4ertus2/events{/privacy}","received_events_url":"https://api.github.com/users/4ertus2/received_events","type":"User","site_admin":false},"body":"It's a query context that should be destroyed with query itself.","created_at":"2018-07-19T14:30:51Z","updated_at":"2018-07-19T14:30:51Z","html_url":"https://github.com/yandex/ClickHouse/pull/2658#discussion_r203749322","pull_request_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2658","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments/203749322"},"html":{"href":"https://github.com/yandex/ClickHouse/pull/2658#discussion_r203749322"},"pull_request":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2658"}},"in_reply_to_id":203723238},"pull_request":{"url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2658","id":201670898,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNjcwODk4","html_url":"https://github.com/yandex/ClickHouse/pull/2658","diff_url":"https://github.com/yandex/ClickHouse/pull/2658.diff","patch_url":"https://github.com/yandex/ClickHouse/pull/2658.patch","issue_url":"https://api.github.com/repos/yandex/ClickHouse/issues/2658","number":2658,"state":"open","locked":false,"title":"CLICKHOUSE-3578 apply column defaults for semistructured input formats","user":{"login":"4ertus2","id":8061274,"node_id":"MDQ6VXNlcjgwNjEyNzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/8061274?v=4","gravatar_id":"","url":"https://api.github.com/users/4ertus2","html_url":"https://github.com/4ertus2","followers_url":"https://api.github.com/users/4ertus2/followers","following_url":"https://api.github.com/users/4ertus2/following{/other_user}","gists_url":"https://api.github.com/users/4ertus2/gists{/gist_id}","starred_url":"https://api.github.com/users/4ertus2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4ertus2/subscriptions","organizations_url":"https://api.github.com/users/4ertus2/orgs","repos_url":"https://api.github.com/users/4ertus2/repos","events_url":"https://api.github.com/users/4ertus2/events{/privacy}","received_events_url":"https://api.github.com/users/4ertus2/received_events","type":"User","site_admin":false},"body":"I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en\r\n","created_at":"2018-07-16T15:16:33Z","updated_at":"2018-07-19T14:30:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6647272ad7a701c424d69a4a54b3be51021818b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2658/commits","review_comments_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2658/comments","review_comment_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yandex/ClickHouse/issues/2658/comments","statuses_url":"https://api.github.com/repos/yandex/ClickHouse/statuses/b87a66b0e38d6a56220c70de82ccb5c6c4332be2","head":{"label":"yandex:issue-3578","ref":"issue-3578","sha":"b87a66b0e38d6a56220c70de82ccb5c6c4332be2","user":{"login":"yandex","id":7409213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MDkyMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/7409213?v=4","gravatar_id":"","url":"https://api.github.com/users/yandex","html_url":"https://github.com/yandex","followers_url":"https://api.github.com/users/yandex/followers","following_url":"https://api.github.com/users/yandex/following{/other_user}","gists_url":"https://api.github.com/users/yandex/gists{/gist_id}","starred_url":"https://api.github.com/users/yandex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandex/subscriptions","organizations_url":"https://api.github.com/users/yandex/orgs","repos_url":"https://api.github.com/users/yandex/repos","events_url":"https://api.github.com/users/yandex/events{/privacy}","received_events_url":"https://api.github.com/users/yandex/received_events","type":"Organization","site_admin":false},"repo":{"id":60246359,"node_id":"MDEwOlJlcG9zaXRvcnk2MDI0NjM1OQ==","name":"ClickHouse","full_name":"yandex/ClickHouse","owner":{"login":"yandex","id":7409213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MDkyMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/7409213?v=4","gravatar_id":"","url":"https://api.github.com/users/yandex","html_url":"https://github.com/yandex","followers_url":"https://api.github.com/users/yandex/followers","following_url":"https://api.github.com/users/yandex/following{/other_user}","gists_url":"https://api.github.com/users/yandex/gists{/gist_id}","starred_url":"https://api.github.com/users/yandex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandex/subscriptions","organizations_url":"https://api.github.com/users/yandex/orgs","repos_url":"https://api.github.com/users/yandex/repos","events_url":"https://api.github.com/users/yandex/events{/privacy}","received_events_url":"https://api.github.com/users/yandex/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yandex/ClickHouse","description":"ClickHouse is a free analytic DBMS for big data.","fork":false,"url":"https://api.github.com/repos/yandex/ClickHouse","forks_url":"https://api.github.com/repos/yandex/ClickHouse/forks","keys_url":"https://api.github.com/repos/yandex/ClickHouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yandex/ClickHouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yandex/ClickHouse/teams","hooks_url":"https://api.github.com/repos/yandex/ClickHouse/hooks","issue_events_url":"https://api.github.com/repos/yandex/ClickHouse/issues/events{/number}","events_url":"https://api.github.com/repos/yandex/ClickHouse/events","assignees_url":"https://api.github.com/repos/yandex/ClickHouse/assignees{/user}","branches_url":"https://api.github.com/repos/yandex/ClickHouse/branches{/branch}","tags_url":"https://api.github.com/repos/yandex/ClickHouse/tags","blobs_url":"https://api.github.com/repos/yandex/ClickHouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yandex/ClickHouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yandex/ClickHouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/yandex/ClickHouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yandex/ClickHouse/statuses/{sha}","languages_url":"https://api.github.com/repos/yandex/ClickHouse/languages","stargazers_url":"https://api.github.com/repos/yandex/ClickHouse/stargazers","contributors_url":"https://api.github.com/repos/yandex/ClickHouse/contributors","subscribers_url":"https://api.github.com/repos/yandex/ClickHouse/subscribers","subscription_url":"https://api.github.com/repos/yandex/ClickHouse/subscription","commits_url":"https://api.github.com/repos/yandex/ClickHouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/yandex/ClickHouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/yandex/ClickHouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/yandex/ClickHouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/yandex/ClickHouse/contents/{+path}","compare_url":"https://api.github.com/repos/yandex/ClickHouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yandex/ClickHouse/merges","archive_url":"https://api.github.com/repos/yandex/ClickHouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yandex/ClickHouse/downloads","issues_url":"https://api.github.com/repos/yandex/ClickHouse/issues{/number}","pulls_url":"https://api.github.com/repos/yandex/ClickHouse/pulls{/number}","milestones_url":"https://api.github.com/repos/yandex/ClickHouse/milestones{/number}","notifications_url":"https://api.github.com/repos/yandex/ClickHouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yandex/ClickHouse/labels{/name}","releases_url":"https://api.github.com/repos/yandex/ClickHouse/releases{/id}","deployments_url":"https://api.github.com/repos/yandex/ClickHouse/deployments","created_at":"2016-06-02T08:28:18Z","updated_at":"2018-07-19T13:53:38Z","pushed_at":"2018-07-19T13:53:33Z","git_url":"git://github.com/yandex/ClickHouse.git","ssh_url":"git@github.com:yandex/ClickHouse.git","clone_url":"https://github.com/yandex/ClickHouse.git","svn_url":"https://github.com/yandex/ClickHouse","homepage":"https://clickhouse.yandex","size":90140,"stargazers_count":4330,"watchers_count":4330,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":676,"mirror_url":null,"archived":false,"open_issues_count":497,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":676,"open_issues":497,"watchers":4330,"default_branch":"master"}},"base":{"label":"yandex:master","ref":"master","sha":"cce2e005c59d50f341f93f3ec05db3d282aff582","user":{"login":"yandex","id":7409213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MDkyMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/7409213?v=4","gravatar_id":"","url":"https://api.github.com/users/yandex","html_url":"https://github.com/yandex","followers_url":"https://api.github.com/users/yandex/followers","following_url":"https://api.github.com/users/yandex/following{/other_user}","gists_url":"https://api.github.com/users/yandex/gists{/gist_id}","starred_url":"https://api.github.com/users/yandex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandex/subscriptions","organizations_url":"https://api.github.com/users/yandex/orgs","repos_url":"https://api.github.com/users/yandex/repos","events_url":"https://api.github.com/users/yandex/events{/privacy}","received_events_url":"https://api.github.com/users/yandex/received_events","type":"Organization","site_admin":false},"repo":{"id":60246359,"node_id":"MDEwOlJlcG9zaXRvcnk2MDI0NjM1OQ==","name":"ClickHouse","full_name":"yandex/ClickHouse","owner":{"login":"yandex","id":7409213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MDkyMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/7409213?v=4","gravatar_id":"","url":"https://api.github.com/users/yandex","html_url":"https://github.com/yandex","followers_url":"https://api.github.com/users/yandex/followers","following_url":"https://api.github.com/users/yandex/following{/other_user}","gists_url":"https://api.github.com/users/yandex/gists{/gist_id}","starred_url":"https://api.github.com/users/yandex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandex/subscriptions","organizations_url":"https://api.github.com/users/yandex/orgs","repos_url":"https://api.github.com/users/yandex/repos","events_url":"https://api.github.com/users/yandex/events{/privacy}","received_events_url":"https://api.github.com/users/yandex/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yandex/ClickHouse","description":"ClickHouse is a free analytic DBMS for big data.","fork":false,"url":"https://api.github.com/repos/yandex/ClickHouse","forks_url":"https://api.github.com/repos/yandex/ClickHouse/forks","keys_url":"https://api.github.com/repos/yandex/ClickHouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yandex/ClickHouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yandex/ClickHouse/teams","hooks_url":"https://api.github.com/repos/yandex/ClickHouse/hooks","issue_events_url":"https://api.github.com/repos/yandex/ClickHouse/issues/events{/number}","events_url":"https://api.github.com/repos/yandex/ClickHouse/events","assignees_url":"https://api.github.com/repos/yandex/ClickHouse/assignees{/user}","branches_url":"https://api.github.com/repos/yandex/ClickHouse/branches{/branch}","tags_url":"https://api.github.com/repos/yandex/ClickHouse/tags","blobs_url":"https://api.github.com/repos/yandex/ClickHouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yandex/ClickHouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yandex/ClickHouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/yandex/ClickHouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yandex/ClickHouse/statuses/{sha}","languages_url":"https://api.github.com/repos/yandex/ClickHouse/languages","stargazers_url":"https://api.github.com/repos/yandex/ClickHouse/stargazers","contributors_url":"https://api.github.com/repos/yandex/ClickHouse/contributors","subscribers_url":"https://api.github.com/repos/yandex/ClickHouse/subscribers","subscription_url":"https://api.github.com/repos/yandex/ClickHouse/subscription","commits_url":"https://api.github.com/repos/yandex/ClickHouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/yandex/ClickHouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/yandex/ClickHouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/yandex/ClickHouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/yandex/ClickHouse/contents/{+path}","compare_url":"https://api.github.com/repos/yandex/ClickHouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yandex/ClickHouse/merges","archive_url":"https://api.github.com/repos/yandex/ClickHouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yandex/ClickHouse/downloads","issues_url":"https://api.github.com/repos/yandex/ClickHouse/issues{/number}","pulls_url":"https://api.github.com/repos/yandex/ClickHouse/pulls{/number}","milestones_url":"https://api.github.com/repos/yandex/ClickHouse/milestones{/number}","notifications_url":"https://api.github.com/repos/yandex/ClickHouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yandex/ClickHouse/labels{/name}","releases_url":"https://api.github.com/repos/yandex/ClickHouse/releases{/id}","deployments_url":"https://api.github.com/repos/yandex/ClickHouse/deployments","created_at":"2016-06-02T08:28:18Z","updated_at":"2018-07-19T13:53:38Z","pushed_at":"2018-07-19T13:53:33Z","git_url":"git://github.com/yandex/ClickHouse.git","ssh_url":"git@github.com:yandex/ClickHouse.git","clone_url":"https://github.com/yandex/ClickHouse.git","svn_url":"https://github.com/yandex/ClickHouse","homepage":"https://clickhouse.yandex","size":90140,"stargazers_count":4330,"watchers_count":4330,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":676,"mirror_url":null,"archived":false,"open_issues_count":497,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":676,"open_issues":497,"watchers":4330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2658"},"html":{"href":"https://github.com/yandex/ClickHouse/pull/2658"},"issue":{"href":"https://api.github.com/repos/yandex/ClickHouse/issues/2658"},"comments":{"href":"https://api.github.com/repos/yandex/ClickHouse/issues/2658/comments"},"review_comments":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2658/comments"},"review_comment":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2658/commits"},"statuses":{"href":"https://api.github.com/repos/yandex/ClickHouse/statuses/b87a66b0e38d6a56220c70de82ccb5c6c4332be2"}},"author_association":"NONE"}}
{"actor":{"display_login":"4ertus2"}}