{"action":"opened","number":3313,"pull_request":{"url":"https://api.github.com/repos/facebook/presto/pulls/3313","id":40441490,"html_url":"https://github.com/facebook/presto/pull/3313","diff_url":"https://github.com/facebook/presto/pull/3313.diff","patch_url":"https://github.com/facebook/presto/pull/3313.patch","issue_url":"https://api.github.com/repos/facebook/presto/issues/3313","number":3313,"state":"open","locked":false,"title":"Fix LIMIT for partitioned row_number with order by","user":{"login":"yaoxin226","id":5962124,"avatar_url":"https://avatars.githubusercontent.com/u/5962124?v=3","gravatar_id":"","url":"https://api.github.com/users/yaoxin226","html_url":"https://github.com/yaoxin226","followers_url":"https://api.github.com/users/yaoxin226/followers","following_url":"https://api.github.com/users/yaoxin226/following{/other_user}","gists_url":"https://api.github.com/users/yaoxin226/gists{/gist_id}","starred_url":"https://api.github.com/users/yaoxin226/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaoxin226/subscriptions","organizations_url":"https://api.github.com/users/yaoxin226/orgs","repos_url":"https://api.github.com/users/yaoxin226/repos","events_url":"https://api.github.com/users/yaoxin226/events{/privacy}","received_events_url":"https://api.github.com/users/yaoxin226/received_events","type":"User","site_admin":false},"body":"The limit was only applied for each order by-ed partition of the window\r\nfunction and not for the entire query.\r\n\r\nWithout this fix, following query will only apply limit to each partition instead of the whole query.\r\n```\r\nSELECT row_number() OVER (PARTITION BY orderstatus ORDER BY orderkey) rn, orderkey \r\nFROM orders\r\nLIMIT 5;\r\n```","created_at":"2015-07-21T10:09:45Z","updated_at":"2015-07-21T10:09:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/presto/pulls/3313/commits","review_comments_url":"https://api.github.com/repos/facebook/presto/pulls/3313/comments","review_comment_url":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/presto/issues/3313/comments","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/778e16de18d45807f3328b89450f97818867c4c9","head":{"label":"hulu:window-orderby-limit","ref":"window-orderby-limit","sha":"778e16de18d45807f3328b89450f97818867c4c9","user":{"login":"hulu","id":502547,"avatar_url":"https://avatars.githubusercontent.com/u/502547?v=3","gravatar_id":"","url":"https://api.github.com/users/hulu","html_url":"https://github.com/hulu","followers_url":"https://api.github.com/users/hulu/followers","following_url":"https://api.github.com/users/hulu/following{/other_user}","gists_url":"https://api.github.com/users/hulu/gists{/gist_id}","starred_url":"https://api.github.com/users/hulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hulu/subscriptions","organizations_url":"https://api.github.com/users/hulu/orgs","repos_url":"https://api.github.com/users/hulu/repos","events_url":"https://api.github.com/users/hulu/events{/privacy}","received_events_url":"https://api.github.com/users/hulu/received_events","type":"Organization","site_admin":false},"repo":{"id":38401368,"name":"presto","full_name":"hulu/presto","owner":{"login":"hulu","id":502547,"avatar_url":"https://avatars.githubusercontent.com/u/502547?v=3","gravatar_id":"","url":"https://api.github.com/users/hulu","html_url":"https://github.com/hulu","followers_url":"https://api.github.com/users/hulu/followers","following_url":"https://api.github.com/users/hulu/following{/other_user}","gists_url":"https://api.github.com/users/hulu/gists{/gist_id}","starred_url":"https://api.github.com/users/hulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hulu/subscriptions","organizations_url":"https://api.github.com/users/hulu/orgs","repos_url":"https://api.github.com/users/hulu/repos","events_url":"https://api.github.com/users/hulu/events{/privacy}","received_events_url":"https://api.github.com/users/hulu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hulu/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":true,"url":"https://api.github.com/repos/hulu/presto","forks_url":"https://api.github.com/repos/hulu/presto/forks","keys_url":"https://api.github.com/repos/hulu/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hulu/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hulu/presto/teams","hooks_url":"https://api.github.com/repos/hulu/presto/hooks","issue_events_url":"https://api.github.com/repos/hulu/presto/issues/events{/number}","events_url":"https://api.github.com/repos/hulu/presto/events","assignees_url":"https://api.github.com/repos/hulu/presto/assignees{/user}","branches_url":"https://api.github.com/repos/hulu/presto/branches{/branch}","tags_url":"https://api.github.com/repos/hulu/presto/tags","blobs_url":"https://api.github.com/repos/hulu/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hulu/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hulu/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/hulu/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hulu/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/hulu/presto/languages","stargazers_url":"https://api.github.com/repos/hulu/presto/stargazers","contributors_url":"https://api.github.com/repos/hulu/presto/contributors","subscribers_url":"https://api.github.com/repos/hulu/presto/subscribers","subscription_url":"https://api.github.com/repos/hulu/presto/subscription","commits_url":"https://api.github.com/repos/hulu/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/hulu/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/hulu/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/hulu/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/hulu/presto/contents/{+path}","compare_url":"https://api.github.com/repos/hulu/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hulu/presto/merges","archive_url":"https://api.github.com/repos/hulu/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hulu/presto/downloads","issues_url":"https://api.github.com/repos/hulu/presto/issues{/number}","pulls_url":"https://api.github.com/repos/hulu/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/hulu/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/hulu/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hulu/presto/labels{/name}","releases_url":"https://api.github.com/repos/hulu/presto/releases{/id}","created_at":"2015-07-02T00:02:19Z","updated_at":"2015-07-02T00:02:27Z","pushed_at":"2015-07-21T10:06:11Z","git_url":"git://github.com/hulu/presto.git","ssh_url":"git@github.com:hulu/presto.git","clone_url":"https://github.com/hulu/presto.git","svn_url":"https://github.com/hulu/presto","homepage":"https://prestodb.io","size":44263,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"ef7b355283582ed7dc562f413b75ec7a4797f329","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"facebook/presto","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":false,"url":"https://api.github.com/repos/facebook/presto","forks_url":"https://api.github.com/repos/facebook/presto/forks","keys_url":"https://api.github.com/repos/facebook/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/presto/teams","hooks_url":"https://api.github.com/repos/facebook/presto/hooks","issue_events_url":"https://api.github.com/repos/facebook/presto/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/presto/events","assignees_url":"https://api.github.com/repos/facebook/presto/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/presto/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/presto/tags","blobs_url":"https://api.github.com/repos/facebook/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/presto/languages","stargazers_url":"https://api.github.com/repos/facebook/presto/stargazers","contributors_url":"https://api.github.com/repos/facebook/presto/contributors","subscribers_url":"https://api.github.com/repos/facebook/presto/subscribers","subscription_url":"https://api.github.com/repos/facebook/presto/subscription","commits_url":"https://api.github.com/repos/facebook/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/presto/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/presto/merges","archive_url":"https://api.github.com/repos/facebook/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/presto/downloads","issues_url":"https://api.github.com/repos/facebook/presto/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/presto/labels{/name}","releases_url":"https://api.github.com/repos/facebook/presto/releases{/id}","created_at":"2012-08-09T01:03:37Z","updated_at":"2015-07-21T07:11:16Z","pushed_at":"2015-07-21T07:45:59Z","git_url":"git://github.com/facebook/presto.git","ssh_url":"git@github.com:facebook/presto.git","clone_url":"https://github.com/facebook/presto.git","svn_url":"https://github.com/facebook/presto","homepage":"https://prestodb.io","size":93615,"stargazers_count":3640,"watchers_count":3640,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":912,"mirror_url":null,"open_issues_count":306,"forks":912,"open_issues":306,"watchers":3640,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/3313"},"html":{"href":"https://github.com/facebook/presto/pull/3313"},"issue":{"href":"https://api.github.com/repos/facebook/presto/issues/3313"},"comments":{"href":"https://api.github.com/repos/facebook/presto/issues/3313/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/presto/pulls/3313/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/presto/pulls/3313/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/presto/statuses/778e16de18d45807f3328b89450f97818867c4c9"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":11,"deletions":3,"changed_files":2}}