Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starrocks-1.0.5.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

starrocks-1.0.5-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file starrocks-1.0.5.tar.gz.

File metadata

  • Download URL: starrocks-1.0.5.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for starrocks-1.0.5.tar.gz
Algorithm Hash digest
SHA256 0963a81c8cc40e8ba4433c96170c5018bc3a8f01db7dc432dd55ac1094aed268
MD5 2f01a04ff5a559fce323e3093878549c
BLAKE2b-256 af5b66bb419622d2a285d8d6f10a29b2482ceff25adf96c979d0888341ffa8fe

See more details on using hashes here.

File details

Details for the file starrocks-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: starrocks-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for starrocks-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f4f2b185e5e5e22631008b0cd5bac1f8b53a0bf404f511bd54b842f7a4ee1f37
MD5 0a7387293de7999f784c36e651b81ca3
BLAKE2b-256 202a6540970e7abf131d09a2cd232e5bfee98cb1380596aae0248890a5944da2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page