{"action":"created","comment":{"url":"https://api.github.com/repos/basho/riak_kv/pulls/comments/48033949","id":48033949,"diff_hunk":"@@ -630,11 +698,11 @@ simplest_test() ->\n     PK = get_standard_pk(),\n     LK = get_standard_lk(),\n     ?assertMatch(\n-        [#riak_sql_v1{ is_executable = true,\n-                       type          = timeseries,\n-                       'WHERE'       = Where2,\n-                       partition_key = PK,\n-                       local_key     = LK }],\n+        {ok, _, [#riak_sql_v1{ is_executable = true,","path":"src/riak_kv_qry_compiler.erl","position":162,"original_position":162,"commit_id":"581b16fba4a2782a8cbbce6e1852e103d2c2df42","original_commit_id":"581b16fba4a2782a8cbbce6e1852e103d2c2df42","user":{"login":"hmmr","id":1107079,"avatar_url":"https://avatars.githubusercontent.com/u/1107079?v=3","gravatar_id":"","url":"https://api.github.com/users/hmmr","html_url":"https://github.com/hmmr","followers_url":"https://api.github.com/users/hmmr/followers","following_url":"https://api.github.com/users/hmmr/following{/other_user}","gists_url":"https://api.github.com/users/hmmr/gists{/gist_id}","starred_url":"https://api.github.com/users/hmmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmmr/subscriptions","organizations_url":"https://api.github.com/users/hmmr/orgs","repos_url":"https://api.github.com/users/hmmr/repos","events_url":"https://api.github.com/users/hmmr/events{/privacy}","received_events_url":"https://api.github.com/users/hmmr/received_events","type":"User","site_admin":false},"body":"The `InitialState` here is `[]`, so I suppose you should be matching against that, rather than `_`.","created_at":"2015-12-18T15:14:29Z","updated_at":"2015-12-18T15:14:29Z","html_url":"https://github.com/basho/riak_kv/pull/1311#discussion_r48033949","pull_request_url":"https://api.github.com/repos/basho/riak_kv/pulls/1311","_links":{"self":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/comments/48033949"},"html":{"href":"https://github.com/basho/riak_kv/pull/1311#discussion_r48033949"},"pull_request":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1311"}}},"pull_request":{"url":"https://api.github.com/repos/basho/riak_kv/pulls/1311","id":54110550,"html_url":"https://github.com/basho/riak_kv/pull/1311","diff_url":"https://github.com/basho/riak_kv/pull/1311.diff","patch_url":"https://github.com/basho/riak_kv/pull/1311.patch","issue_url":"https://api.github.com/repos/basho/riak_kv/issues/1311","number":1311,"state":"open","locked":false,"title":"Window aggregate functions","user":{"login":"andytill","id":213455,"avatar_url":"https://avatars.githubusercontent.com/u/213455?v=3","gravatar_id":"","url":"https://api.github.com/users/andytill","html_url":"https://github.com/andytill","followers_url":"https://api.github.com/users/andytill/followers","following_url":"https://api.github.com/users/andytill/following{/other_user}","gists_url":"https://api.github.com/users/andytill/gists{/gist_id}","starred_url":"https://api.github.com/users/andytill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andytill/subscriptions","organizations_url":"https://api.github.com/users/andytill/orgs","repos_url":"https://api.github.com/users/andytill/repos","events_url":"https://api.github.com/users/andytill/events{/privacy}","received_events_url":"https://api.github.com/users/andytill/received_events","type":"User","site_admin":false},"body":"**Do not merge**\r\nSupport window aggregate functions in riak_kv, such as the following:\r\n\r\n```sql\r\nSELECT count(*) FROM mytable\r\nWHERE time > 1234560 AND time < 1234570 AND myfamily = 'family1' AND myseries = 'series1'\r\n```\r\n\r\nRun in the erlang shell using the erlang riak client looks like the following:\r\n\r\n```erlang\r\n120> riakc_ts:query(Pid, \"select count(myseries) from GeoCheckin where time > 1234560 and time < 1234570 and myfamily = 'family1' and myseries = 'series1'\").   \r\n{[<<\"aggregate\">>],[{3}]}\r\n```\r\n\r\nOne current limitation is that all return column names are `<<\"aggregate\">>` and all column return types are `sint64`.  Column names will eventually be the selection e.g. `count(*)` in this case and the correct return type will be returned for that function by checking the type signature in riak_ql.","created_at":"2015-12-18T14:53:05Z","updated_at":"2015-12-18T15:14:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/basho/riak_kv/pulls/1311/commits","review_comments_url":"https://api.github.com/repos/basho/riak_kv/pulls/1311/comments","review_comment_url":"https://api.github.com/repos/basho/riak_kv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/basho/riak_kv/issues/1311/comments","statuses_url":"https://api.github.com/repos/basho/riak_kv/statuses/581b16fba4a2782a8cbbce6e1852e103d2c2df42","head":{"label":"basho:at/aggregations_compiler","ref":"at/aggregations_compiler","sha":"581b16fba4a2782a8cbbce6e1852e103d2c2df42","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":791522,"name":"riak_kv","full_name":"basho/riak_kv","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_kv","description":"Riak Key/Value Store","fork":false,"url":"https://api.github.com/repos/basho/riak_kv","forks_url":"https://api.github.com/repos/basho/riak_kv/forks","keys_url":"https://api.github.com/repos/basho/riak_kv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_kv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_kv/teams","hooks_url":"https://api.github.com/repos/basho/riak_kv/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_kv/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_kv/events","assignees_url":"https://api.github.com/repos/basho/riak_kv/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_kv/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_kv/tags","blobs_url":"https://api.github.com/repos/basho/riak_kv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_kv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_kv/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_kv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_kv/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_kv/languages","stargazers_url":"https://api.github.com/repos/basho/riak_kv/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_kv/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_kv/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_kv/subscription","commits_url":"https://api.github.com/repos/basho/riak_kv/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_kv/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_kv/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_kv/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_kv/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_kv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_kv/merges","archive_url":"https://api.github.com/repos/basho/riak_kv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_kv/downloads","issues_url":"https://api.github.com/repos/basho/riak_kv/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_kv/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_kv/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_kv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_kv/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_kv/releases{/id}","created_at":"2010-07-22T17:27:35Z","updated_at":"2015-12-17T03:52:16Z","pushed_at":"2015-12-18T14:53:05Z","git_url":"git://github.com/basho/riak_kv.git","ssh_url":"git@github.com:basho/riak_kv.git","clone_url":"https://github.com/basho/riak_kv.git","svn_url":"https://github.com/basho/riak_kv","homepage":"","size":14632,"stargazers_count":281,"watchers_count":281,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":171,"forks":125,"open_issues":171,"watchers":281,"default_branch":"develop"}},"base":{"label":"basho:end-to-end/timeseries","ref":"end-to-end/timeseries","sha":"2e7daca40f10a37ffa3b898dc179caddf62ec522","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":791522,"name":"riak_kv","full_name":"basho/riak_kv","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_kv","description":"Riak Key/Value Store","fork":false,"url":"https://api.github.com/repos/basho/riak_kv","forks_url":"https://api.github.com/repos/basho/riak_kv/forks","keys_url":"https://api.github.com/repos/basho/riak_kv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_kv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_kv/teams","hooks_url":"https://api.github.com/repos/basho/riak_kv/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_kv/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_kv/events","assignees_url":"https://api.github.com/repos/basho/riak_kv/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_kv/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_kv/tags","blobs_url":"https://api.github.com/repos/basho/riak_kv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_kv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_kv/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_kv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_kv/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_kv/languages","stargazers_url":"https://api.github.com/repos/basho/riak_kv/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_kv/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_kv/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_kv/subscription","commits_url":"https://api.github.com/repos/basho/riak_kv/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_kv/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_kv/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_kv/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_kv/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_kv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_kv/merges","archive_url":"https://api.github.com/repos/basho/riak_kv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_kv/downloads","issues_url":"https://api.github.com/repos/basho/riak_kv/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_kv/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_kv/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_kv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_kv/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_kv/releases{/id}","created_at":"2010-07-22T17:27:35Z","updated_at":"2015-12-17T03:52:16Z","pushed_at":"2015-12-18T14:53:05Z","git_url":"git://github.com/basho/riak_kv.git","ssh_url":"git@github.com:basho/riak_kv.git","clone_url":"https://github.com/basho/riak_kv.git","svn_url":"https://github.com/basho/riak_kv","homepage":"","size":14632,"stargazers_count":281,"watchers_count":281,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":171,"forks":125,"open_issues":171,"watchers":281,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1311"},"html":{"href":"https://github.com/basho/riak_kv/pull/1311"},"issue":{"href":"https://api.github.com/repos/basho/riak_kv/issues/1311"},"comments":{"href":"https://api.github.com/repos/basho/riak_kv/issues/1311/comments"},"review_comments":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1311/comments"},"review_comment":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1311/commits"},"statuses":{"href":"https://api.github.com/repos/basho/riak_kv/statuses/581b16fba4a2782a8cbbce6e1852e103d2c2df42"}}}}