Broker Query API
REST API on the Broker
Pinot can be queried via a broker endpoint as follows. This example assumes broker is running on localhost:8099
The Pinot REST API can be accessed by invoking POST operation with a JSON body containing the parameter sql to the /query/sql endpoint on a broker.
When TLS/SSL is not enabled:
$ curl -H "Content-Type: application/json" -X POST \
-d '{"sql":"select foo, count(*) from myTable group by foo limit 100"}' \
http://localhost:8099/query/sqlWhen TLS/SSL is enabled:
$ curl -k -H "Content-Type: application/json" -X POST \
-d '{"sql":"select foo, count(*) from myTable group by foo limit 100"}' \
https://localhost:8099/query/sqlIf the SQL statement contains ", in the JSON body, it needs to be replaced by '"'"', for example:
$ curl -H "Content-Type: application/json" -X POST \
-d '{"sql":"select foo, count(*) from myTable where foo='"'"'abc'"'"' limit 100"}' \
http://localhost:8099/query/sqlQuery Console
Use Query Console to run ad hoc queries. Access the Query Console by entering the <controller host>:<controller port> in your browser.

pinot-admin
You can also query using the pinot-admin scripts. Make sure you follow instructions in Getting Pinot to get Pinot locally, and then
Last updated
Was this helpful?

