{"action":"closed","number":2272,"pull_request":{"url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2272","id":183651330,"html_url":"https://github.com/yandex/ClickHouse/pull/2272","diff_url":"https://github.com/yandex/ClickHouse/pull/2272.diff","patch_url":"https://github.com/yandex/ClickHouse/pull/2272.patch","issue_url":"https://api.github.com/repos/yandex/ClickHouse/issues/2272","number":2272,"state":"closed","locked":false,"title":"Conditional computations.","user":{"login":"ilyshnikova","id":9670676,"avatar_url":"https://avatars2.githubusercontent.com/u/9670676?v=4","gravatar_id":"","url":"https://api.github.com/users/ilyshnikova","html_url":"https://github.com/ilyshnikova","followers_url":"https://api.github.com/users/ilyshnikova/followers","following_url":"https://api.github.com/users/ilyshnikova/following{/other_user}","gists_url":"https://api.github.com/users/ilyshnikova/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyshnikova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyshnikova/subscriptions","organizations_url":"https://api.github.com/users/ilyshnikova/orgs","repos_url":"https://api.github.com/users/ilyshnikova/repos","events_url":"https://api.github.com/users/ilyshnikova/events{/privacy}","received_events_url":"https://api.github.com/users/ilyshnikova/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\r\nВ этом реквесте содержится правка, которая позволяет вычислять аргументы функции and не везде, а только на определенных подмножествах строк. \r\n\r\nВключается эта функциональность опцией клиента enable_conditional_computation. По-дефолту, функциональность выклчена\r\n\r\nПример работы\r\n```\r\nubuntu.members.linode.com :) select arrayMap(x -> x and modulo(1,x), [0,1,2]);\r\n\r\nSELECT arrayMap(x -> (x AND (1 % x)), [0, 1, 2])\r\n\r\nReceived exception from server (version 1.1.54380):\r\nCode: 153. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Division by zero. \r\n\r\n0 rows in set. Elapsed: 0.402 sec. \r\n\r\nubuntu.members.linode.com :) set enable_conditional_computation=1;\r\n\r\nSET enable_conditional_computation = 1\r\n\r\nOk.\r\n\r\n0 rows in set. Elapsed: 0.002 sec. \r\n\r\nubuntu.members.linode.com :) select arrayMap(x -> x and modulo(1,x), [0,1,2]);\r\n\r\nSELECT arrayMap(x -> (x AND (1 % x)), [0, 1, 2])\r\n\r\n┌─arrayMap(lambda(tuple(x), and(x, modulo(1, x))), [0, 1, 2])─┐\r\n│ [0,0,1]                                                     │\r\n└─────────────────────────────────────────────────────────────┘\r\n\r\n1 rows in set. Elapsed: 0.011 sec. \r\n\r\nubuntu.members.linode.com :)\r\n```\r\n\r\nОсобенность реквеста: приходится пробрасывать в execute количество входных строк, из-за кейсов, где аргумент фукнции \"and\" может не иметь никаких входных параметров и угадать число строк результата невозможно внутри выполнения функции, только подсказать ей снаружи, как в примере ```f and emptyArrayUInt8()``` \r\n\r\nВ остальном все просто: добавлены функции проекции, восстановления и взятия композиции проекций и построен способ выбора экшенов, который использует эти функции для вычисления результата. ","created_at":"2018-04-24T08:03:46Z","updated_at":"2018-05-01T19:08:47Z","closed_at":"2018-05-01T19:08:47Z","merged_at":"2018-05-01T19:08:47Z","merge_commit_sha":"9be89bd0d47fa8109691191b61524b812cf1c55c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2272/commits","review_comments_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2272/comments","review_comment_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yandex/ClickHouse/issues/2272/comments","statuses_url":"https://api.github.com/repos/yandex/ClickHouse/statuses/9412222f5539bd45459307d960a87bcaaa94fea4","head":{"label":"ilyshnikova:master","ref":"master","sha":"9412222f5539bd45459307d960a87bcaaa94fea4","user":{"login":"ilyshnikova","id":9670676,"avatar_url":"https://avatars2.githubusercontent.com/u/9670676?v=4","gravatar_id":"","url":"https://api.github.com/users/ilyshnikova","html_url":"https://github.com/ilyshnikova","followers_url":"https://api.github.com/users/ilyshnikova/followers","following_url":"https://api.github.com/users/ilyshnikova/following{/other_user}","gists_url":"https://api.github.com/users/ilyshnikova/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyshnikova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyshnikova/subscriptions","organizations_url":"https://api.github.com/users/ilyshnikova/orgs","repos_url":"https://api.github.com/users/ilyshnikova/repos","events_url":"https://api.github.com/users/ilyshnikova/events{/privacy}","received_events_url":"https://api.github.com/users/ilyshnikova/received_events","type":"User","site_admin":false},"repo":{"id":117135368,"name":"ClickHouse","full_name":"ilyshnikova/ClickHouse","owner":{"login":"ilyshnikova","id":9670676,"avatar_url":"https://avatars2.githubusercontent.com/u/9670676?v=4","gravatar_id":"","url":"https://api.github.com/users/ilyshnikova","html_url":"https://github.com/ilyshnikova","followers_url":"https://api.github.com/users/ilyshnikova/followers","following_url":"https://api.github.com/users/ilyshnikova/following{/other_user}","gists_url":"https://api.github.com/users/ilyshnikova/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyshnikova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyshnikova/subscriptions","organizations_url":"https://api.github.com/users/ilyshnikova/orgs","repos_url":"https://api.github.com/users/ilyshnikova/repos","events_url":"https://api.github.com/users/ilyshnikova/events{/privacy}","received_events_url":"https://api.github.com/users/ilyshnikova/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilyshnikova/ClickHouse","description":"ClickHouse is a free analytic DBMS for big data.","fork":true,"url":"https://api.github.com/repos/ilyshnikova/ClickHouse","forks_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/forks","keys_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/teams","hooks_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/hooks","issue_events_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/issues/events{/number}","events_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/events","assignees_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/assignees{/user}","branches_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/branches{/branch}","tags_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/tags","blobs_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/statuses/{sha}","languages_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/languages","stargazers_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/stargazers","contributors_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/contributors","subscribers_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/subscribers","subscription_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/subscription","commits_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/contents/{+path}","compare_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/merges","archive_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/downloads","issues_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/issues{/number}","pulls_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/pulls{/number}","milestones_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/milestones{/number}","notifications_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/labels{/name}","releases_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/releases{/id}","deployments_url":"https://api.github.com/repos/ilyshnikova/ClickHouse/deployments","created_at":"2018-01-11T18:10:51Z","updated_at":"2018-05-01T13:34:34Z","pushed_at":"2018-05-01T13:34:32Z","git_url":"git://github.com/ilyshnikova/ClickHouse.git","ssh_url":"git@github.com:ilyshnikova/ClickHouse.git","clone_url":"https://github.com/ilyshnikova/ClickHouse.git","svn_url":"https://github.com/ilyshnikova/ClickHouse","homepage":"https://clickhouse.yandex","size":84872,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yandex:master","ref":"master","sha":"093c054b1f9e3cce9a969caeb75b09157dfeac05","user":{"login":"yandex","id":7409213,"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,"name":"ClickHouse","full_name":"yandex/ClickHouse","owner":{"login":"yandex","id":7409213,"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-05-01T18:51:13Z","pushed_at":"2018-05-01T19:08:47Z","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":85203,"stargazers_count":3973,"watchers_count":3973,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":596,"mirror_url":null,"archived":false,"open_issues_count":413,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":596,"open_issues":413,"watchers":3973,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2272"},"html":{"href":"https://github.com/yandex/ClickHouse/pull/2272"},"issue":{"href":"https://api.github.com/repos/yandex/ClickHouse/issues/2272"},"comments":{"href":"https://api.github.com/repos/yandex/ClickHouse/issues/2272/comments"},"review_comments":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2272/comments"},"review_comment":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2272/commits"},"statuses":{"href":"https://api.github.com/repos/yandex/ClickHouse/statuses/9412222f5539bd45459307d960a87bcaaa94fea4"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"alexey-milovidov","id":18581488,"avatar_url":"https://avatars3.githubusercontent.com/u/18581488?v=4","gravatar_id":"","url":"https://api.github.com/users/alexey-milovidov","html_url":"https://github.com/alexey-milovidov","followers_url":"https://api.github.com/users/alexey-milovidov/followers","following_url":"https://api.github.com/users/alexey-milovidov/following{/other_user}","gists_url":"https://api.github.com/users/alexey-milovidov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexey-milovidov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexey-milovidov/subscriptions","organizations_url":"https://api.github.com/users/alexey-milovidov/orgs","repos_url":"https://api.github.com/users/alexey-milovidov/repos","events_url":"https://api.github.com/users/alexey-milovidov/events{/privacy}","received_events_url":"https://api.github.com/users/alexey-milovidov/received_events","type":"User","site_admin":false},"comments":0,"review_comments":18,"maintainer_can_modify":false,"commits":9,"additions":1764,"deletions":616,"changed_files":64}}
{"actor":{"display_login":"alexey-milovidov"}}