{"action":"created","issue":{"url":"https://api.github.com/repos/yandex/ClickHouse/issues/1656","repository_url":"https://api.github.com/repos/yandex/ClickHouse","labels_url":"https://api.github.com/repos/yandex/ClickHouse/issues/1656/labels{/name}","comments_url":"https://api.github.com/repos/yandex/ClickHouse/issues/1656/comments","events_url":"https://api.github.com/repos/yandex/ClickHouse/issues/1656/events","html_url":"https://github.com/yandex/ClickHouse/issues/1656","id":282634428,"node_id":"MDU6SXNzdWUyODI2MzQ0Mjg=","number":1656,"title":"allow reading from a SET storage","user":{"login":"silviucpp","id":4814731,"node_id":"MDQ6VXNlcjQ4MTQ3MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/4814731?v=4","gravatar_id":"","url":"https://api.github.com/users/silviucpp","html_url":"https://github.com/silviucpp","followers_url":"https://api.github.com/users/silviucpp/followers","following_url":"https://api.github.com/users/silviucpp/following{/other_user}","gists_url":"https://api.github.com/users/silviucpp/gists{/gist_id}","starred_url":"https://api.github.com/users/silviucpp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silviucpp/subscriptions","organizations_url":"https://api.github.com/users/silviucpp/orgs","repos_url":"https://api.github.com/users/silviucpp/repos","events_url":"https://api.github.com/users/silviucpp/events{/privacy}","received_events_url":"https://api.github.com/users/silviucpp/received_events","type":"User","site_admin":false},"labels":[{"id":520905553,"node_id":"MDU6TGFiZWw1MjA5MDU1NTM=","url":"https://api.github.com/repos/yandex/ClickHouse/labels/feature","name":"feature","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":{"login":"silviucpp","id":4814731,"node_id":"MDQ6VXNlcjQ4MTQ3MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/4814731?v=4","gravatar_id":"","url":"https://api.github.com/users/silviucpp","html_url":"https://github.com/silviucpp","followers_url":"https://api.github.com/users/silviucpp/followers","following_url":"https://api.github.com/users/silviucpp/following{/other_user}","gists_url":"https://api.github.com/users/silviucpp/gists{/gist_id}","starred_url":"https://api.github.com/users/silviucpp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silviucpp/subscriptions","organizations_url":"https://api.github.com/users/silviucpp/orgs","repos_url":"https://api.github.com/users/silviucpp/repos","events_url":"https://api.github.com/users/silviucpp/events{/privacy}","received_events_url":"https://api.github.com/users/silviucpp/received_events","type":"User","site_admin":false},"assignees":[{"login":"silviucpp","id":4814731,"node_id":"MDQ6VXNlcjQ4MTQ3MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/4814731?v=4","gravatar_id":"","url":"https://api.github.com/users/silviucpp","html_url":"https://github.com/silviucpp","followers_url":"https://api.github.com/users/silviucpp/followers","following_url":"https://api.github.com/users/silviucpp/following{/other_user}","gists_url":"https://api.github.com/users/silviucpp/gists{/gist_id}","starred_url":"https://api.github.com/users/silviucpp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silviucpp/subscriptions","organizations_url":"https://api.github.com/users/silviucpp/orgs","repos_url":"https://api.github.com/users/silviucpp/repos","events_url":"https://api.github.com/users/silviucpp/events{/privacy}","received_events_url":"https://api.github.com/users/silviucpp/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2017-12-16T16:38:58Z","updated_at":"2018-07-11T14:45:48Z","closed_at":null,"author_association":"NONE","body":"Hello guys,\r\n\r\nAny reason from not allowing reading from a storage of type Set ? Right now a storage of Set type can be used only with an IN clause.\r\n\r\nFor example I have the following scenario: I need to run a query on table A based on different filters and get from there all unique users, then in the app I need to know which are this users and also I need to run a second query on another table where one of the filter is user_id IN (result from query A).\r\n\r\nRight now from what I see the only option is:\r\n\r\n1. do first query like : SELECT DISTINCT user_id FROM table_a WHERE ...\r\n2. process the list in my app (let`s say send them an email)\r\n3. run second query like : SELECT a,b,c,d FROM table2 where user_id IN (same query like in point 1) AND ..\r\n\r\nThis is not optimal as time query from point 1 will run twice.\r\n\r\nIn my mind the optimal way is :\r\n\r\n1. do first query and save result in a SetStorage\r\n2. read all data from the set storage in the app \r\n3. run second query and in IN clause add the set storage as input\r\n\r\nAre you interested in a PR that will add read support for set storage ? Or do you see any other way to implement what I need without running query 1 two times\r\n\r\nSilviu\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/yandex/ClickHouse/issues/comments/404196080","html_url":"https://github.com/yandex/ClickHouse/issues/1656#issuecomment-404196080","issue_url":"https://api.github.com/repos/yandex/ClickHouse/issues/1656","id":404196080,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDE5NjA4MA==","user":{"login":"alex-zaitsev","id":25770686,"node_id":"MDQ6VXNlcjI1NzcwNjg2","avatar_url":"https://avatars2.githubusercontent.com/u/25770686?v=4","gravatar_id":"","url":"https://api.github.com/users/alex-zaitsev","html_url":"https://github.com/alex-zaitsev","followers_url":"https://api.github.com/users/alex-zaitsev/followers","following_url":"https://api.github.com/users/alex-zaitsev/following{/other_user}","gists_url":"https://api.github.com/users/alex-zaitsev/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-zaitsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-zaitsev/subscriptions","organizations_url":"https://api.github.com/users/alex-zaitsev/orgs","repos_url":"https://api.github.com/users/alex-zaitsev/repos","events_url":"https://api.github.com/users/alex-zaitsev/events{/privacy}","received_events_url":"https://api.github.com/users/alex-zaitsev/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T14:45:48Z","updated_at":"2018-07-11T14:45:48Z","author_association":"NONE","body":"Supporting TRUNCATE for Set tables would be useful as well."}}
{"actor":{"display_login":"alex-zaitsev"}}