{"action":"created","issue":{"url":"https://api.github.com/repos/cmu-db/peloton/issues/385","repository_url":"https://api.github.com/repos/cmu-db/peloton","labels_url":"https://api.github.com/repos/cmu-db/peloton/issues/385/labels{/name}","comments_url":"https://api.github.com/repos/cmu-db/peloton/issues/385/comments","events_url":"https://api.github.com/repos/cmu-db/peloton/issues/385/events","html_url":"https://github.com/cmu-db/peloton/issues/385","id":193947806,"number":385,"title":"ORDER BY is Broken","user":{"login":"apavlo","id":718045,"avatar_url":"https://avatars.githubusercontent.com/u/718045?v=3","gravatar_id":"","url":"https://api.github.com/users/apavlo","html_url":"https://github.com/apavlo","followers_url":"https://api.github.com/users/apavlo/followers","following_url":"https://api.github.com/users/apavlo/following{/other_user}","gists_url":"https://api.github.com/users/apavlo/gists{/gist_id}","starred_url":"https://api.github.com/users/apavlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apavlo/subscriptions","organizations_url":"https://api.github.com/users/apavlo/orgs","repos_url":"https://api.github.com/users/apavlo/repos","events_url":"https://api.github.com/users/apavlo/events{/privacy}","received_events_url":"https://api.github.com/users/apavlo/received_events","type":"User","site_admin":false},"labels":[{"id":158835809,"url":"https://api.github.com/repos/cmu-db/peloton/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"sid1607","id":2364222,"avatar_url":"https://avatars.githubusercontent.com/u/2364222?v=3","gravatar_id":"","url":"https://api.github.com/users/sid1607","html_url":"https://github.com/sid1607","followers_url":"https://api.github.com/users/sid1607/followers","following_url":"https://api.github.com/users/sid1607/following{/other_user}","gists_url":"https://api.github.com/users/sid1607/gists{/gist_id}","starred_url":"https://api.github.com/users/sid1607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sid1607/subscriptions","organizations_url":"https://api.github.com/users/sid1607/orgs","repos_url":"https://api.github.com/users/sid1607/repos","events_url":"https://api.github.com/users/sid1607/events{/privacy}","received_events_url":"https://api.github.com/users/sid1607/received_events","type":"User","site_admin":false},"assignees":[{"login":"sid1607","id":2364222,"avatar_url":"https://avatars.githubusercontent.com/u/2364222?v=3","gravatar_id":"","url":"https://api.github.com/users/sid1607","html_url":"https://github.com/sid1607","followers_url":"https://api.github.com/users/sid1607/followers","following_url":"https://api.github.com/users/sid1607/following{/other_user}","gists_url":"https://api.github.com/users/sid1607/gists{/gist_id}","starred_url":"https://api.github.com/users/sid1607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sid1607/subscriptions","organizations_url":"https://api.github.com/users/sid1607/orgs","repos_url":"https://api.github.com/users/sid1607/repos","events_url":"https://api.github.com/users/sid1607/events{/privacy}","received_events_url":"https://api.github.com/users/sid1607/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/cmu-db/peloton/milestones/1","html_url":"https://github.com/cmu-db/peloton/milestone/1","labels_url":"https://api.github.com/repos/cmu-db/peloton/milestones/1/labels","id":2171538,"number":1,"title":"tpcc","description":null,"creator":{"login":"apavlo","id":718045,"avatar_url":"https://avatars.githubusercontent.com/u/718045?v=3","gravatar_id":"","url":"https://api.github.com/users/apavlo","html_url":"https://github.com/apavlo","followers_url":"https://api.github.com/users/apavlo/followers","following_url":"https://api.github.com/users/apavlo/following{/other_user}","gists_url":"https://api.github.com/users/apavlo/gists{/gist_id}","starred_url":"https://api.github.com/users/apavlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apavlo/subscriptions","organizations_url":"https://api.github.com/users/apavlo/orgs","repos_url":"https://api.github.com/users/apavlo/repos","events_url":"https://api.github.com/users/apavlo/events{/privacy}","received_events_url":"https://api.github.com/users/apavlo/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":11,"state":"open","created_at":"2016-12-02T16:29:40Z","updated_at":"2016-12-28T21:02:33Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-12-07T03:17:41Z","updated_at":"2017-01-14T00:41:23Z","closed_at":null,"body":"We don't support `ORDER BY` with a `SELECT *` query:\r\n```\r\npostgres=# create table foo(id integer PRIMARY KEY, year integer);\r\ncreate table foo(id integer PRIMARY KEY, year integer) 0\r\npostgres=# insert into foo values(1, 100);\r\ninsert into foo values(1, 100) 1\r\npostgres=# insert into foo values(2, 200);\r\ninsert into foo values(2, 200) 1\r\npostgres=# insert into foo values(3, 150);\r\ninsert into foo values(3, 150) 1\r\npostgres=# SELECT * FROM foo ORDER BY year;\r\nserver closed the connection unexpectedly\r\n```\r\nThe server gives the following error:\r\n```\r\n[ERROR] [src/optimizer/simple_optimizer.cpp:285:BuildPelotonPlanTree()] 2016-12-06 22:13:27 - Not supported: Ordering column is not an element of select list!\r\n```\r\nBut if you make the `SELECT` include the column you want to sort on, then it works:\r\n```\r\npostgres=# SELECT id, year FROM foo ORDER BY year;\r\n id | year \r\n----+------\r\n  1 |  100\r\n  3 |  150\r\n  2 |  200\r\n(3 rows)\r\n```\r\nWhen you remove `year` from the output list, we crash again:\r\n```\r\npostgres=# SELECT id FROM foo ORDER BY year;\r\nserver closed the connection unexpectedly\r\n```"},"comment":{"url":"https://api.github.com/repos/cmu-db/peloton/issues/comments/272585538","html_url":"https://github.com/cmu-db/peloton/issues/385#issuecomment-272585538","issue_url":"https://api.github.com/repos/cmu-db/peloton/issues/385","id":272585538,"user":{"login":"PauloAmora","id":2302077,"avatar_url":"https://avatars.githubusercontent.com/u/2302077?v=3","gravatar_id":"","url":"https://api.github.com/users/PauloAmora","html_url":"https://github.com/PauloAmora","followers_url":"https://api.github.com/users/PauloAmora/followers","following_url":"https://api.github.com/users/PauloAmora/following{/other_user}","gists_url":"https://api.github.com/users/PauloAmora/gists{/gist_id}","starred_url":"https://api.github.com/users/PauloAmora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PauloAmora/subscriptions","organizations_url":"https://api.github.com/users/PauloAmora/orgs","repos_url":"https://api.github.com/users/PauloAmora/repos","events_url":"https://api.github.com/users/PauloAmora/events{/privacy}","received_events_url":"https://api.github.com/users/PauloAmora/received_events","type":"User","site_admin":false},"created_at":"2017-01-14T00:41:23Z","updated_at":"2017-01-14T00:41:23Z","body":"@Michael-Tieying-Zhang @apavlo @jarulraj \r\nSo, I managed to get `select * from table order by column` working. However, it seems like a whole other flow. I'll submit the PR now so you guys can have a look. "}}
{"actor":{"display_login":"PauloAmora"}}