pinotdb is a Python library providing a DB-API 2.0 interface and a SQLAlchemy dialect for Apache Pinot. It enables Python applications to connect to and query Pinot clusters using standard SQL. The library is actively maintained with frequent releases, currently at version 9.1.1, and requires Apache Pinot server version 0.3.0 or later for its SQL API functionality.
pip install pinotdb==9.1.1Verified import paths — ran on the pinned version, not inferred.
This example demonstrates how to connect to an Apache Pinot broker using the DB-API 2.0 interface and execute a simple SQL query. It fetches the count of records from a hypothetical 'baseballStats' table and prints the results and query statistics. Authentication details are optional and can be provided via environment variables.
Upgrade your Python environment to 3.10 or newer (current requirement: >=3.10, <4).
Upgrade your Python environment to 3.9 or newer before upgrading to `pinotdb` 6.0.0, or 3.10+ for later versions.
Review SQLAlchemy 2.0 migration guides and update your SQLAlchemy-dependent code. Alternatively, pin `pinotdb` to a version prior to 8.0.0 if you must remain on SQLAlchemy 1.x.
Upgrade to `pinotdb` 9.1.1 or newer to benefit from the fix addressing clear-text logging of sensitive data.
Ensure your Apache Pinot cluster is running a version that supports the SQL API (0.3.0 or later) when using recent `pinotdb` clients. For older Pinot clusters, consider using `pinotdb` 0.2.x if PQL is necessary, but be aware of missing newer features.
Ensure your Apache Pinot broker is running and accessible from the client's network. Verify the host and port configuration used by `pinotdb` and check network connectivity and firewall rules.
Provide explicit 'username' and 'password' parameters in the `pinotdb.connect()` call if your Pinot cluster requires authentication. For example: `conn = connect(host='localhost', port=8000, path='/query/sql', username='your_username', password='your_password')`.
Verify that the Pinot broker is running and accessible at the specified 'host' and 'port' in your `pinotdb.connect()` call. Check network connectivity and ensure no firewall is blocking the connection to the Pinot broker port (commonly 8000 or 8099 for queries).
Ensure that the table named in your SQL query exists in the Pinot cluster and is correctly configured and online. Check the Pinot controller UI or logs for table status and broker assignments.
Install the 'pinotdb' package using pip: `pip install pinotdb`. If using virtual environments, ensure you are activating the correct environment before running your Python script.