You can query your Pinot data by sending a POST request to the Pinot broker’s /query/sql
endpoint. This endpoint accepts a JSON body containing your SQL query.
The basic structure of the request involves:
/query/sql
sql
, whose value is your SQL query string.Content-Type
header to application/json
. If you are using StarTree Cloud, you will also need an Authorization
header with a Bearer token. StarTree Trial accounts require an additional database
header.Obtain a service token for authentication.
Here are some examples using the curl command-line tool:
When querying a Pinot cluster hosted on StarTree Cloud, you need to include an API token for authentication.
Remember to replace <your url>
with your specific StarTree Cloud URL and <API Token>
with your generated token.
If you have a Pinot broker running locally (for example, on localhost:8099), you can query it directly:
Replace yourTableName
with the actual name of your table.
You can cenerate an API token in the Data Portal or using the REST API.
This token is used in the Authorization header of your API requests.
To find the correct Broker URL for your table in StarTree Cloud:
You can query your Pinot data by sending a POST request to the Pinot broker’s /query/sql
endpoint. This endpoint accepts a JSON body containing your SQL query.
The basic structure of the request involves:
/query/sql
sql
, whose value is your SQL query string.Content-Type
header to application/json
. If you are using StarTree Cloud, you will also need an Authorization
header with a Bearer token. StarTree Trial accounts require an additional database
header.Obtain a service token for authentication.
Here are some examples using the curl command-line tool:
When querying a Pinot cluster hosted on StarTree Cloud, you need to include an API token for authentication.
Remember to replace <your url>
with your specific StarTree Cloud URL and <API Token>
with your generated token.
If you have a Pinot broker running locally (for example, on localhost:8099), you can query it directly:
Replace yourTableName
with the actual name of your table.
You can cenerate an API token in the Data Portal or using the REST API.
This token is used in the Authorization header of your API requests.
To find the correct Broker URL for your table in StarTree Cloud: