blcksrx / pypinot

A DB-API to interact with Apache Pinot
Apache License 2.0
1 stars 1 forks source link
apache-pinot dbapi pinot python

Pypinot

License Build Status PyPI version

Python DB-API for Apache Pinot

Apache Pinot is a realtime distributed OLAP datastore, designed to answer OLAP queries with low latency. This package provides DB API to interact with Apache Pinot

Installaion

pip install pypinot

Usage

Using the DB API:

from pypinot.connection import Connection

conn = Connection(host='localhost', port=8099, path='/query', scheme='http')
cur = conn.cursor()
cur.execute("""
    SELECT place,
           CAST(REGEXP_EXTRACT(place, '(.*),', 1) AS FLOAT) AS lat,
           CAST(REGEXP_EXTRACT(place, ',(.*)', 1) AS FLOAT) AS lon
      FROM places
     LIMIT 10
""")
for row in cur:
    print(row)

Contribution

Your Contribution is welcome!