Skip to content

Instantly share code, notes, and snippets.

@martint
Last active January 23, 2016 01:17

Revisions

  1. martint revised this gist Jan 23, 2016. 1 changed file with 1 addition and 13 deletions.
    14 changes: 1 addition & 13 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1 @@
    * Make a `POST` to `/v1/statement` with the query
    * You get back a JSON document that might contain a `nextUri` link
    * The document will contain `columns` if available
    * The document will contain `data` if available
    * The `columns` field will always be set if `data` is set (and usually earlier)
    * If there is no `nextUri` link, then the query is finished (either successfully completed or failed)
    * Otherwise, keep following the `nextUri` link
    * The `status` field is only for displaying to humans as a hint about the query's state on the server. It is not in sync in the query state from the client's perspective and must not be used to determine whether the query is finished.
    * The document will contain an `error` field if the query has failed -- this is how you distinguish between a successfully completed query and a failed query when there is no more `nextUri` link
    * If the response is an HTTP `503`, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP `200` with Content-Type `application/json`, then consider the query failed (this means something has gone wrong, for example, you might receive a `404` or `410`)
    * The document format is exactly the same for the POST response and the `nextUri` link response -- you might get `data` immediately as a response to the `POST`, or it might take many requests for a longer query

    See https://github.com/facebook/presto/wiki/HTTP-Protocol
  2. martint revised this gist Jun 6, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -9,5 +9,5 @@
    * The document will contain an `error` field if the query has failed -- this is how you distinguish between a successfully completed query and a failed query when there is no more `nextUri` link
    * If the response is an HTTP `503`, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP `200` with Content-Type `application/json`, then consider the query failed (this means something has gone wrong, for example, you might receive a `404` or `410`)
    * The document format is exactly the same for the POST response and the `nextUri` link response — you might get `data` immediately as a response to the `POST`, or it might take many requests for a longer query
    * The document format is exactly the same for the POST response and the `nextUri` link response -- you might get `data` immediately as a response to the `POST`, or it might take many requests for a longer query

  3. martint revised this gist Jun 6, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    * If there is no `nextUri` link, then the query is finished (either successfully completed or failed)
    * Otherwise, keep following the `nextUri` link
    * The `status` field is only for displaying to humans as a hint about the query's state on the server. It is not in sync in the query state from the client's perspective and must not be used to determine whether the query is finished.
    * The document will contain an `error` field if the query has failed — this is how you distinguish between a successfully completed query and a failed query when there is no more `nextUri` link
    * The document will contain an `error` field if the query has failed -- this is how you distinguish between a successfully completed query and a failed query when there is no more `nextUri` link
    * If the response is an HTTP `503`, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP `200` with Content-Type `application/json`, then consider the query failed (this means something has gone wrong, for example, you might receive a `404` or `410`)
    * The document format is exactly the same for the POST response and the `nextUri` link response — you might get `data` immediately as a response to the `POST`, or it might take many requests for a longer query
  4. martint revised this gist Jun 6, 2015. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,13 @@
    * Make a `POST` to `/v1/statement` with the query
    * You get back a JSON document that might contain a `next` link
    * You get back a JSON document that might contain a `nextUri` link
    * The document will contain `columns` if available
    * The document will contain `data` if available
    * The `columns` field will always be set if `data` is set (and usually earlier)
    * If there is no `next` link, then the query is finished (either successfully completed or failed). The `status` field is for information only. It should not be used to determine whether the query is finished
    * Otherwise, keep following the `next` link
    * The document will contain an `error` field if the query has failed — this is how you distinguish between a successfully completed query and a failed query when there is no more `next` link
    * If there is no `nextUri` link, then the query is finished (either successfully completed or failed)
    * Otherwise, keep following the `nextUri` link
    * The `status` field is only for displaying to humans as a hint about the query's state on the server. It is not in sync in the query state from the client's perspective and must not be used to determine whether the query is finished.
    * The document will contain an `error` field if the query has failed — this is how you distinguish between a successfully completed query and a failed query when there is no more `nextUri` link
    * If the response is an HTTP `503`, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP `200` with Content-Type `application/json`, then consider the query failed (this means something has gone wrong, for example, you might receive a `404` or `410`)
    * The document format is exactly the same for the POST response and the `next` link response you might get `data` immediately as a response to the `POST`, or it might take requests for a longer query
    * The document format is exactly the same for the POST response and the `nextUri` link response — you might get `data` immediately as a response to the `POST`, or it might take many requests for a longer query

  5. martint revised this gist Nov 6, 2013. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    * Make a POST to /v1/statement with the query
    * Make a `POST` to `/v1/statement` with the query
    * You get back a JSON document that might contain a `next` link
    * The document will contain `columns` if available
    * The document will contain `data` if available
    * The `columns` field will always be set if "data" is set (and usually earlier)
    * The `columns` field will always be set if `data` is set (and usually earlier)
    * If there is no `next` link, then the query is finished (either successfully completed or failed). The `status` field is for information only. It should not be used to determine whether the query is finished
    * Otherwise, keep following the `next` link
    * The document will contain an `error` field if the query has failed — this is how you distinguish between a successfully completed query and a failed query when there is no more `next` link
    * If the response is an HTTP 503, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP 200 with Content-Type `application/json`, then consider the query failed (this means something has gone wrong, for example, you might receive a 404 or 410)
    * The document format is exactly the same for the POST response and the `next` link response — you might get `data` immediately as a response to the POST, or it might take requests for a longer query
    * If the response is an HTTP `503`, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP `200` with Content-Type `application/json`, then consider the query failed (this means something has gone wrong, for example, you might receive a `404` or `410`)
    * The document format is exactly the same for the POST response and the `next` link response — you might get `data` immediately as a response to the `POST`, or it might take requests for a longer query

  6. martint revised this gist Nov 6, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -3,10 +3,10 @@
    * The document will contain `columns` if available
    * The document will contain `data` if available
    * The `columns` field will always be set if "data" is set (and usually earlier)
    * If there is no "next" link, then the query is finished (either successfully completed or failed). The `status` field is for information only. It should not be used to determine whether the query is finished
    * If there is no `next` link, then the query is finished (either successfully completed or failed). The `status` field is for information only. It should not be used to determine whether the query is finished
    * Otherwise, keep following the `next` link
    * The document will contain an `error` field if the query has failed — this is how you distinguish between a successfully completed query and a failed query when there is no more `next` link
    * If the response is an HTTP 503, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP 200 with Content-Type "application/json", then consider the query failed (this means something has gone wrong, for example, you might receive a 404 or 410)
    * Otherwise, if the response is anything other than an HTTP 200 with Content-Type `application/json`, then consider the query failed (this means something has gone wrong, for example, you might receive a 404 or 410)
    * The document format is exactly the same for the POST response and the `next` link response — you might get `data` immediately as a response to the POST, or it might take requests for a longer query

  7. martint revised this gist Nov 6, 2013. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,12 @@
    * Make a POST to /v1/statement with the query
    * You get back a JSON document that might contain a "next" link
    * The document will contain "columns" if available
    * The document will contain "data" if available
    * The "columns" field will always be set if "data" is set (and usually earlier)
    * If there is no "next" link, then the query is finished (either successfully completed or failed)
    * Otherwise, keep following the "next" link
    * The document will contain an "error" field if the query has failed — this is how you distinguish between a successfully completed query and a failed query when there is no more "next" link
    * You get back a JSON document that might contain a `next` link
    * The document will contain `columns` if available
    * The document will contain `data` if available
    * The `columns` field will always be set if "data" is set (and usually earlier)
    * If there is no "next" link, then the query is finished (either successfully completed or failed). The `status` field is for information only. It should not be used to determine whether the query is finished
    * Otherwise, keep following the `next` link
    * The document will contain an `error` field if the query has failed — this is how you distinguish between a successfully completed query and a failed query when there is no more `next` link
    * If the response is an HTTP 503, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP 200 with Content-Type "application/json", then consider the query failed (this means something has gone wrong, for example, you might receive a 404 or 410)
    * The document format is exactly the same for the POST response and the "next" link response — you might get "data" immediately as a response to the POST, or it might take requests for a longer query
    * The document format is exactly the same for the POST response and the `next` link response — you might get `data` immediately as a response to the POST, or it might take requests for a longer query

  8. martint renamed this gist Nov 6, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. martint created this gist Nov 6, 2013.
    11 changes: 11 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    * Make a POST to /v1/statement with the query
    * You get back a JSON document that might contain a "next" link
    * The document will contain "columns" if available
    * The document will contain "data" if available
    * The "columns" field will always be set if "data" is set (and usually earlier)
    * If there is no "next" link, then the query is finished (either successfully completed or failed)
    * Otherwise, keep following the "next" link
    * The document will contain an "error" field if the query has failed — this is how you distinguish between a successfully completed query and a failed query when there is no more "next" link
    * If the response is an HTTP 503, sleep 50-100ms and try again
    * Otherwise, if the response is anything other than an HTTP 200 with Content-Type "application/json", then consider the query failed (this means something has gone wrong, for example, you might receive a 404 or 410)
    * The document format is exactly the same for the POST response and the "next" link response — you might get "data" immediately as a response to the POST, or it might take requests for a longer query