You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/10/12 07:32:34 UTC

[GitHub] [pulsar] Jennifer88huang commented on a change in pull request #5376: [docs] Add presto sql REST APIs doc

Jennifer88huang commented on a change in pull request #5376: [docs] Add presto sql REST APIs doc
URL: https://github.com/apache/pulsar/pull/5376#discussion_r334225484
 
 

 ##########
 File path: site2/docs/sql-rest-api.md
 ##########
 @@ -0,0 +1,185 @@
+---
+id: sql-rest-api
+title: Pulsar SQL REST APIs
+sidebar_label: REST APIs
+---
+
+## Presto HTTP API
+
+Presto configuration in Pulsar is: conf/presto/config.properties
+
+Get cluster status (HTTP method: GET)
+
+```
+localhost:8081/v1/cluster
+```
+
+You can input your SQL as an HTTP request body, and send it to `localhost:8081/v1/statement`.
+
+For example:
+
+```
+HTTP request URL : `localhost:8081/v1/statement`
+HTTP header:  X-Presto-User: username
+HTTP body: `show catalogs`
+```
+
+> For more HTTP header, refer to https://github.com/prestosql/presto/blob/master/presto-client/src/main/java/io/prestosql/client/PrestoHeaders.java )
+
+
+You will receive information like this:
+```
+{
+    "id": "20190522_083232_00012_tk5nc",
+    "infoUri": "http://localhost:8081/ui/query.html?20190522_083232_00012_tk5nc",
+    "nextUri": "http://localhost:8081/v1/statement/20190522_083232_00012_tk5nc/1",
+    "stats": {
+        "state": "QUEUED",
+        "queued": true,
+        "scheduled": false,
+        "nodes": 0,
+        "totalSplits": 0,
+        "queuedSplits": 0,
+        "runningSplits": 0,
+        "completedSplits": 0,
+        "userTimeMillis": 0,
+        "cpuTimeMillis": 0,
+        "wallTimeMillis": 0,
+        "queuedTimeMillis": 0,
+        "elapsedTimeMillis": 0,
+        "processedRows": 0,
+        "processedBytes": 0,
+        "peakMemoryBytes": 0
+    }
+}
+```
+
+Then you need to request the `nextUri` using the GET method, and you will receive information like this:
 
 Review comment:
   ```suggestion
   You need to request `nextUri` using the GET method, and receive information like this:
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services