{"action":"created","issue":{"url":"https://api.github.com/repos/pipelinedb/pipelinedb/issues/1733","repository_url":"https://api.github.com/repos/pipelinedb/pipelinedb","labels_url":"https://api.github.com/repos/pipelinedb/pipelinedb/issues/1733/labels{/name}","comments_url":"https://api.github.com/repos/pipelinedb/pipelinedb/issues/1733/comments","events_url":"https://api.github.com/repos/pipelinedb/pipelinedb/issues/1733/events","html_url":"https://github.com/pipelinedb/pipelinedb/issues/1733","id":197912151,"number":1733,"title":"Support combine on VIEWs over CVs","user":{"login":"EliSnow","id":714089,"avatar_url":"https://avatars.githubusercontent.com/u/714089?v=3","gravatar_id":"","url":"https://api.github.com/users/EliSnow","html_url":"https://github.com/EliSnow","followers_url":"https://api.github.com/users/EliSnow/followers","following_url":"https://api.github.com/users/EliSnow/following{/other_user}","gists_url":"https://api.github.com/users/EliSnow/gists{/gist_id}","starred_url":"https://api.github.com/users/EliSnow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EliSnow/subscriptions","organizations_url":"https://api.github.com/users/EliSnow/orgs","repos_url":"https://api.github.com/users/EliSnow/repos","events_url":"https://api.github.com/users/EliSnow/events{/privacy}","received_events_url":"https://api.github.com/users/EliSnow/received_events","type":"User","site_admin":false},"labels":[{"id":272547639,"url":"https://api.github.com/repos/pipelinedb/pipelinedb/labels/feature%20request","name":"feature request","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":{"login":"derekjn","id":384666,"avatar_url":"https://avatars.githubusercontent.com/u/384666?v=3","gravatar_id":"","url":"https://api.github.com/users/derekjn","html_url":"https://github.com/derekjn","followers_url":"https://api.github.com/users/derekjn/followers","following_url":"https://api.github.com/users/derekjn/following{/other_user}","gists_url":"https://api.github.com/users/derekjn/gists{/gist_id}","starred_url":"https://api.github.com/users/derekjn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekjn/subscriptions","organizations_url":"https://api.github.com/users/derekjn/orgs","repos_url":"https://api.github.com/users/derekjn/repos","events_url":"https://api.github.com/users/derekjn/events{/privacy}","received_events_url":"https://api.github.com/users/derekjn/received_events","type":"User","site_admin":false},"assignees":[{"login":"derekjn","id":384666,"avatar_url":"https://avatars.githubusercontent.com/u/384666?v=3","gravatar_id":"","url":"https://api.github.com/users/derekjn","html_url":"https://github.com/derekjn","followers_url":"https://api.github.com/users/derekjn/followers","following_url":"https://api.github.com/users/derekjn/following{/other_user}","gists_url":"https://api.github.com/users/derekjn/gists{/gist_id}","starred_url":"https://api.github.com/users/derekjn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekjn/subscriptions","organizations_url":"https://api.github.com/users/derekjn/orgs","repos_url":"https://api.github.com/users/derekjn/repos","events_url":"https://api.github.com/users/derekjn/events{/privacy}","received_events_url":"https://api.github.com/users/derekjn/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-12-28T20:33:00Z","updated_at":"2016-12-29T16:44:57Z","closed_at":null,"body":"With the addition of `output_of` and especially `delta` rows, a common use case would be to have CVs which \"rollup\" data. It would make a lot of sense to be able to combine across multiple `CONTINUOUS VIEW`s. Here's a simplified example:\r\n\r\n```sql\r\nCREATE STREAM s (n int);\r\n\r\nCREATE CONTINUOUS VIEW cv1 AS\r\nSELECT\r\n  tdigest_agg(n) AS tdigest,\r\n  date_round(arrival_timestamp, '5m') AS ts\r\nFROM s\r\nGROUP BY ts;\r\n\r\nCREATE CONTINUOUS VIEW cv2 AS\r\nSELECT\r\n  combine((delta).tdigest) AS tdigest,\r\n  date_round((delta).ts, '1h') AS ts\r\nFROM output_of('cv1')\r\nGROUP BY 2;\r\n\r\nINSERT INTO s (n) SELECT n FROM generate_series(1, 100) AS n;\r\n\r\nCREATE VIEW v AS\r\nSELECT *, '5m'::interval FROM cv1\r\nUNION ALL\r\nSELECT *, '1h'::interval FROM cv2;\r\n\r\nSELECT combine(tdigest) FROM v;\r\n-- ERROR:  the FROM clause is not a continuous view\r\n-- HINT:  Only aggregate continuous view columns can be combined.\r\n```\r\n\r\nI have also tried creating a `VIEW` which does a `UNION ALL` over `cv1_mrel` and `cv2_mrel` (based off the output of `pipeline_get_overlay_viewdef('cv1')`) and that too results in the same error.\r\n\r\nOne possible solution would be to allow the creation of  `CONTINUOUS VIEW`s which are strictly a `UNION ALL` of multiple CVs, that way `combine` can still be captured by the same mechanisms which currently exist. This could also be useful for some future CV partitioning feature."},"comment":{"url":"https://api.github.com/repos/pipelinedb/pipelinedb/issues/comments/269657425","html_url":"https://github.com/pipelinedb/pipelinedb/issues/1733#issuecomment-269657425","issue_url":"https://api.github.com/repos/pipelinedb/pipelinedb/issues/1733","id":269657425,"user":{"login":"EliSnow","id":714089,"avatar_url":"https://avatars.githubusercontent.com/u/714089?v=3","gravatar_id":"","url":"https://api.github.com/users/EliSnow","html_url":"https://github.com/EliSnow","followers_url":"https://api.github.com/users/EliSnow/followers","following_url":"https://api.github.com/users/EliSnow/following{/other_user}","gists_url":"https://api.github.com/users/EliSnow/gists{/gist_id}","starred_url":"https://api.github.com/users/EliSnow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EliSnow/subscriptions","organizations_url":"https://api.github.com/users/EliSnow/orgs","repos_url":"https://api.github.com/users/EliSnow/repos","events_url":"https://api.github.com/users/EliSnow/events{/privacy}","received_events_url":"https://api.github.com/users/EliSnow/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T16:44:57Z","updated_at":"2016-12-29T16:44:57Z","body":"@derekjn, as long as this is a matter of getting the analyzer to be smarter can this feature also be made to work on columns coming from a CV in a subquery or CTE?"}}
{"actor":{"display_login":"EliSnow"}}