SQLAlchemy Dialect for Databricks
Project description
sqlalchemy-databricks
A SQLAlchemy Dialect for Databricks workspace and sql analytics clusters using the officially supported databricks-sql-connector dbapi.
Installation
Install using pip.
pip install sqlalchemy-databricks
Usage
Installing registers the databricks+connector
dialect/driver with SQLAlchemy. Fill in the required information when passing the engine URL. The http path can be for either a workspace or sql analytics cluster.
from sqlalchemy import *
from sqlalchemy.engine import create_engine
engine = create_engine(
"databricks+connector://token:<databricks_token>@<databricks_host>:443/<database_or_schema_name>",
connect_args={
"http_path": "<cluster_http_path>",
},
)
logs = Table("my_table", MetaData(bind=engine), autoload=True)
print(select([func.count("*")], from_obj=logs).scalar())
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
Close
Hashes for sqlalchemy-databricks-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6efc02643962a1841eeb9139b942efc0246440c9cef3e7f7ebb3ea8d38eb5c0 |
|
MD5 | 90787037dc068e5d01f139fa6dff175e |
|
BLAKE2b-256 | 354de83a8fb0203b2e8747b247b3e839cfe591caf3855c038009065bbe755b29 |
Close
Hashes for sqlalchemy_databricks-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c34e85727c289f742c258ce236fe7c95bcc4bcc3a2872b724cc2da20f4db8c |
|
MD5 | 6b5e49ecada3f5a4fa4ce33ead03faa2 |
|
BLAKE2b-256 | 2849bdfb7e9d2a6de4b9fd20a90442a00c9bf4109bbb09e9a5a68c86e98babb0 |