Python interface to StarRocks
Project description
StarRocks Python Client
A StarRocks client for the Python programming language.
StarRocks is the next-generation data platform designed to make data-intensive real-time analytics fast and easy. It delivers query speeds 5 to 10 times faster than other popular solutions. StarRocks can perform real-time analytics well while updating historical records. It can also enhance real-time analytics with historical data from data lakes easily. With StarRocks, you can get rid of the de-normalized tables and get the best performance and flexibility.
Installation
pip install starrocks
SQLAlchemy Usage
To connect to StarRocks using SQLAlchemy, use a connection string (URL) following this pattern:
- User: User Name
- Password: DBPassword
- Host: StarRocks FE Host
- Catalog: Catalog Name
- Database: Database Name
- Port: StarRocks FE port
Here's what the connection string looks like:
starrocks://<User>:<Password>@<Host>:<Port>/<Catalog>.<Database>
Example
It is recommended to use python 3.x to connect to the StarRocks database, eg:
from sqlalchemy import create_engine
from sqlalchemy.schema import Table, MetaData
from sqlalchemy.sql.expression import select, text
engine = create_engine('starrocks://root:xxx@localhost:9030/hive_catalog.hive_db')
connection = engine.connect()
rows = connection.execute(text("SELECT * FROM hive_table")).fetchall()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for starrocks-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a064a3ae7d6cfbdccb86af7345a7dde11c9aacfa11e10fdd03223fcc9d16975b |
|
MD5 | a0d92ffd8378ee98159cf71a1be10d69 |
|
BLAKE2b-256 | ffab45c13fb50b850dd3157aebbe296184cbe53b918b3ab4b5af1c29178221fe |