dolthub / dolthub-issues

Issues for dolthub.com
https://dolthub.com
4 stars 1 forks source link

Rows come back in sorted order from the SQL API #497

Open timsehn opened 1 year ago

timsehn commented 1 year ago

Rows are returned from the API in a random order, not the expected SQL order.

Here are few successive responses to a select * from table query:

{"query_execution_status":"Success","query_execution_message":"","repository_owner":"timsehn","repository_name":"google_sheets","commit_ref":"main","sql_query":"select * from test","schema":[{"columnName":"id","columnType":"int"},{"columnName":"words","columnType":"varchar(255)"}],"rows":[{"id":"0","words":"Tim is not awesome"},{"id":"4","words":"He is a shitty coder"},{"id":"5","words":"I swear he cannot fo this"},{"id":"6","words":"He is a bum"},{"id":"7","words":"I think he can't"},{"id":"2","words":"Tim can't make this work"},{"id":"1","words":"Tim is the worst"},{"id":"3","words":"Be fair to him"}]}
{"query_execution_status":"Success","query_execution_message":"","repository_owner":"timsehn","repository_name":"google_sheets","commit_ref":"main","sql_query":"select * from test","schema":[{"columnName":"id","columnType":"int"},{"columnName":"words","columnType":"varchar(255)"}],"rows":[{"id":"0","words":"Tim is not awesome"},{"id":"1","words":"Tim is the worst"},{"id":"5","words":"I swear he cannot fo this"},{"id":"6","words":"He is a bum"},{"id":"7","words":"I think he can't"},{"id":"2","words":"Tim can't make this work"},{"id":"4","words":"He is a shitty coder"},{"id":"3","words":"Be fair to him"}]}
{"query_execution_status":"Success","query_execution_message":"","repository_owner":"timsehn","repository_name":"google_sheets","commit_ref":"main","sql_query":"select * from test","schema":[{"columnName":"id","columnType":"int"},{"columnName":"words","columnType":"varchar(255)"}],"rows":[{"id":"1","words":"Tim is the worst"},{"id":"0","words":"Tim is not awesome"},{"id":"4","words":"He is a shitty coder"},{"id":"6","words":"He is a bum"},{"id":"3","words":"Be fair to him"},{"id":"7","words":"I think he can't"},{"id":"2","words":"Tim can't make this work"},{"id":"5","words":"I swear he cannot fo this"}]}

I would expect the rows to be returned consistently in order of id like they would come out of a SQL client.