adbc-driver-kinetica
The Arrow ADBC driver for Kinetica, packaged for Python.
The package carries the driver for your platform and hands it to the ADBC driver manager, so the connection you get back is a standard ADBC one: anything the ADBC Python documentation describes works here. Query results come back from the server as Arrow, with no row-by-row conversion in between.
Install
pip install adbc-driver-kinetica
pip install "adbc-driver-kinetica[dataframe]" # adds pandas, for fetch_df
Wheels are published for Linux (x86-64 and ARM64), macOS (Apple silicon) and
Windows (x86-64), for Python 3.11 or later. On Windows ARM64, the x64 build of
Python installs the x86-64 wheel; there is no ARM64 wheel yet, since pyarrow,
which the package needs, does not publish one. The driver needs Kinetica 7.2.3.24
or later, the first version to return query results as Arrow; it refuses a
connection to an older server when it opens, and says which version it found.
The package's version follows Kinetica's: 7.2.x releases are for Kinetica
7.2. To take every release for 7.2 and none for a later Kinetica version:
pip install "adbc-driver-kinetica~=7.2.0"
Connect
import adbc_driver_kinetica.dbapi as kinetica
conn = kinetica.connect(
"http://localhost:9191",
db_kwargs={"username": "<user>", "password": "<password>"},
)
The address may also be a kinetica:// URI,
kinetica://[user[:password]@]host[:port][,host[:port]...][/path][?name=value&...].
It connects over HTTPS unless it says tls=false, and every other parameter
is an option under its own name, such as kinetica.query.max_rows=1000; an
option set directly takes precedence over the URI's.
Query
cur = conn.cursor()
cur.execute("SELECT 1 AS n, 'hello' AS s")
cur.fetchall() # [(1, 'hello')]
Arrow is the native result, so take it directly rather than row by row when the result is large:
cur.execute("SELECT * FROM my_table")
table = cur.fetch_arrow_table() # pyarrow.Table
frame = cur.fetch_df() # pandas.DataFrame, needs [dataframe]
Parameters use the driver's placeholders:
cur.execute("SELECT * FROM my_table WHERE id = ?", (42,))
Change data
cur.execute("CREATE TABLE t (id INTEGER, name VARCHAR)")
cur.execute("INSERT INTO t VALUES (1, 'one'), (2, 'two')")
cur.execute("UPDATE t SET name = 'TWO' WHERE id = 2")
cur.execute("DELETE FROM t WHERE id = 1")
For anything more than a few rows, hand over an Arrow table and let the driver
route it to the worker ranks instead of building a long INSERT:
import pyarrow as pa
batch = pa.table({"id": [1, 2, 3], "name": ["one", "two", "three"]})
cur.adbc_ingest("t", batch, mode="append") # or "create", "replace"
Read the catalog
conn.adbc_get_table_schema("t") # pyarrow.Schema
conn.adbc_get_objects(depth="tables").read_all()
Transactions
Kinetica has no multi-statement transactions. Autocommit is always on, so
commit() and rollback() are refused, and the driver manager warns once:
Warning: Cannot disable autocommit; conn will not be DB-API 2.0 compliant
The connection works normally. A tool that insists on calling them can have them accepted and ignored instead, so that both succeed and do nothing:
conn = kinetica.connect(
"http://localhost:9191",
db_kwargs={"username": "<user>", "password": "<password>",
"kinetica.fake_transactions": "true"},
)
Nothing is actually held back either way: a statement has taken effect by the time it returns.
Temp tables and sessions
A connection is a server session, and the SQL #name temp tables it creates
belong to that session alone: two connections can each have their own #work
without colliding. Closing the connection drops them.
cur.execute("CREATE TABLE #work (a INT)")
cur.execute("INSERT INTO #work VALUES (1)")
...
conn.close() # #work goes with the session
To share them instead, name the session. Every connection given the same id
sees the same #name tables:
conn = kinetica.connect(
"http://localhost:9191",
db_kwargs={"username": "<user>", "password": "<password>",
"kinetica.session_id": "reporting-run-42"},
)
A session you name is yours to drop, with /drop/session sent under the same
X-Kinetica-Session header; closing the connection leaves it alone. Left
alone entirely, the server drops any session idle for longer than
sql.session_idle_timeout (an hour by default).
Without this package
The same driver can be installed for every language at once with
dbc, and loaded by name through
adbc-driver-manager 1.8 or later:
dbc install kinetica
import adbc_driver_manager.dbapi as dbapi
conn = dbapi.connect(
driver="kinetica",
db_kwargs={"uri": "http://localhost:9191",
"username": "<user>", "password": "<password>"},
)
Environment
| variable | meaning |
|---|---|
KINETICA_ADBC_LIB |
path to a driver library to load instead of the one the package carries; a path that does not exist is an error |
Metadata
Release files for adbc-driver-kinetica 7.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| adbc_driver_kinetica-7.2.1-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for adbc_driver_kinetica-7.2.1-py3-none-win_amd64.whl |
| adbc_driver_kinetica-7.2.1-py3-none-manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for adbc_driver_kinetica-7.2.1-py3-none-manylinux_2_17_x86_64.whl |
| adbc_driver_kinetica-7.2.1-py3-none-manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details for adbc_driver_kinetica-7.2.1-py3-none-manylinux_2_17_aarch64.whl |
| adbc_driver_kinetica-7.2.1-py3-none-macosx_13_0_arm64.whl | Python 3 | none | macOS 13.0+ ARM64 | Details for adbc_driver_kinetica-7.2.1-py3-none-macosx_13_0_arm64.whl |
Total release size: 39.0 MB
Release files / adbc_driver_kinetica-7.2.1-py3-none-win_amd64.whl
| Download URL | adbc_driver_kinetica-7.2.1-py3-none-win_amd64.whl |
|---|---|
| Size | 9.2 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f84d12b1383c3de88f22a79fca34be911c0da6eb58075c1576e1bac0fa444919
|
|
BLAKE2b-256 checksum How to use checksums |
e9fbdb7b6d4f491ee62f5ac8f58e12c8a93b0964564d2fc94a9371cd94e51158
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / adbc_driver_kinetica-7.2.1-py3-none-manylinux_2_17_x86_64.whl
| Download URL | adbc_driver_kinetica-7.2.1-py3-none-manylinux_2_17_x86_64.whl |
|---|---|
| Size | 10.4 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
190ddf0c95cb68a102fa89ab5591a81f0bf08fc400b8dd58a33019ab4d1dfabc
|
|
BLAKE2b-256 checksum How to use checksums |
7ecf3063f8ea8f672aaca9159cd0f8361ec45777c1ce6833db117c81ba037bbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / adbc_driver_kinetica-7.2.1-py3-none-manylinux_2_17_aarch64.whl
| Download URL | adbc_driver_kinetica-7.2.1-py3-none-manylinux_2_17_aarch64.whl |
|---|---|
| Size | 10.4 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
9645d8170c4092c720b8f993e3c9957276a9234884cd780d9e4aa7fbc44cda8b
|
|
BLAKE2b-256 checksum How to use checksums |
aff6608cbde3251b8669936624b4d4cb607c6f82027b4c8f69183b5d186a69a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / adbc_driver_kinetica-7.2.1-py3-none-macosx_13_0_arm64.whl
| Download URL | adbc_driver_kinetica-7.2.1-py3-none-macosx_13_0_arm64.whl |
|---|---|
| Size | 9.0 MB |
| Tags | Python 3 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f095c347872a12a0e6bc8acaf29ac5eef38996e0fee29eb6f1463ae27a54b89a
|
|
BLAKE2b-256 checksum How to use checksums |
5894ae4b6fb91b49534edd2de400fb0a91d32760949aaa0994eb9f8e26bff0b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Security for adbc-driver-kinetica 7.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.