Databricks SQL Connector for Python
Project description
Databricks SQL Connector for Python
Status: Public Preview
This library is currently shared as Public Preview. Documentation can be found here: Databricks SQL Connector for Python .
About
The Databricks SQL Connector is a Python library that allows you to use Python code to run SQL commands on Databricks clusters and Databricks SQL endpoints. This library follows PEP 249 -- Python Database API Specification v2.0.
Quickstart
Install the library with pip install databricks-sql-connector
Example usage:
from databricks import sql
connection = sql.connect(
server_hostname='<server-hostname>',
http_path='<http-path>',
access_token='<personal-access-token>')
cursor = connection.cursor()
cursor.execute('SELECT * FROM RANGE(10)')
result = cursor.fetchall()
for row in result:
print(row)
cursor.close()
connection.close()
Where:
<server-hostname>
is the Databricks instance host name.<http-path>
is the HTTP Path either to a Databricks SQL endpoint (e.g. /sql/1.0/endpoints/1234567890abcdef), or to a Databricks Runtime interactive cluster (e.g. /sql/protocolv1/o/1234567890123456/1234-123456-slid123)<personal-access-token>
is a HTTP Bearer access token, e.g. a Databricks Personal Access Token.
For more information, see Databricks documentation.
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 databricks-sql-connector-0.9.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89b92b13232fa749651ee8f499232dc130ec3f1a70c4b9ecef4de4ee1477bd80 |
|
MD5 | 590df10b44409cc9d2c89dc692d24dac |
|
BLAKE2b-256 | 18bef24a582791785a8b858429b4cc0d0b34a7cd8effafccbfdfa40191ecb555 |
Close
Hashes for databricks_sql_connector-0.9.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b670ed9a0aac5a9e31cc4316abf1018c1ac02d4352b2f50ee33a4a73e70c9d36 |
|
MD5 | f0c1a05b999ebaf78ef4756296fc1640 |
|
BLAKE2b-256 | 10ead7b55edfe8cc71c8e45c5566c3b15d4b7d7023faba8716295e061683cc94 |