Query Resource
The Query REST service is the most complex of the rest services. It contains detailed information about nodes, and other details that capture the state and history of a query being executed on a Presto installation.
GET /v1/query()
This service returns information and statistics about queries that are currently being executed on a Presto coordinator.
When you point a web browser at a Presto coordinate you’ll see a rendered version of the output from this service which will display recent queries that have executed on a Presto installation.
GET /v1/query/{queryId}()
If you are looking to gather very detailed statistics about a query, this is the service you would call. If you load the web interface of a Presto coordinator you will see a list of current queries. Clicking on a query will reveal a link to this service.
Example response:
1. {
2. "queryId" : "20131229_211533_00017_dk5x2",
3. "session" : {
4. "user" : "tobrien",
5. "source" : "presto-cli",
6. "catalog" : "jmx",
7. "schema" : "jmx",
8. "remoteUserAddress" : "173.15.79.89",
9. "userAgent" : "StatementClient/0.55-SNAPSHOT",
10. "startTime" : 1388351852026
11. },
12. "state" : "FINISHED",
13. "self" : "http://10.193.207.128:8080/v1/query/20131229_211533_00017_dk5x2",
14. "fieldNames" : [ "name" ],
15. "query" : "select name from \"java.lang:type=runtime\"",
16. "queryStats" : {
17. "createTime" : "2013-12-29T16:17:32.027-05:00",
18. "executionStartTime" : "2013-12-29T16:17:32.086-05:00",
19. "lastHeartbeat" : "2013-12-29T16:17:44.561-05:00",
20. "endTime" : "2013-12-29T16:17:32.152-05:00",
21. "elapsedTime" : "125.00ms",
22. "queuedTime" : "1.31ms",
23. "analysisTime" : "4.84ms",
24. "totalTasks" : 2,
25. "runningTasks" : 0,
26. "completedTasks" : 2,
27. "totalDrivers" : 2,
28. "queuedDrivers" : 0,
29. "runningDrivers" : 0,
30. "completedDrivers" : 2,
31. "totalMemoryReservation" : "0B",
32. "totalScheduledTime" : "5.84ms",
33. "totalCpuTime" : "710.49us",
34. "totalBlockedTime" : "27.38ms",
35. "rawInputDataSize" : "27B",
36. "rawInputPositions" : 1,
37. "processedInputDataSize" : "32B",
38. "processedInputPositions" : 1,
39. "outputDataSize" : "32B",
40. "outputPositions" : 1
41. },
42. "outputStage" : { }
43. }
