Query Interfaces
Connecting to StarTree Cloud using Python
Applications can use the Python client library to query StarTree Cloud.
Prerequisites
- Ensure you have the latest
pinotdb
library installed. To install the library, run the following command in your terminal:
Usage
Query the Pinot Broker Directly
Use SQLAlchemy to Query Pinot
The db engine connection string is formatted like this: pinot://:?controller=://:/
Clone the Python pinot-dbapi Repository
Obtaining Username and Password
You can cenerate an API token in the Data Portal or using the REST API. Then, obtain the username and password from the service token
Th username and password are used to authorize your API requests.
Finding Your Broker URL
To find the correct Broker URL for your table in StarTree Cloud:
- Access the Data Portal.
- Click on Tables.
- Select the specific table you want to query.
- From the browser address bar, copy the URL to your Pinot cluster. For example, if the URL shown is
https://dp.1abcde6.cp.s7e.startree.cloud/tables
, then the Broker URL for the table will bebroker.pinot.1abcde6.cp.s7e.startree.cloud
.