Skip to main content

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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for adbc-driver-kinetica 7.2.2
File Actions
adbc_driver_kinetica-7.2.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for adbc_driver_kinetica-7.2.2-py3-none-win_amd64.whl
adbc_driver_kinetica-7.2.2-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for adbc_driver_kinetica-7.2.2-py3-none-manylinux_2_17_x86_64.whl
adbc_driver_kinetica-7.2.2-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for adbc_driver_kinetica-7.2.2-py3-none-manylinux_2_17_aarch64.whl
adbc_driver_kinetica-7.2.2-py3-none-macosx_13_0_arm64.whl Python 3 none macOS 13.0+ ARM64 Details for adbc_driver_kinetica-7.2.2-py3-none-macosx_13_0_arm64.whl

Total release size: 39.0 MB

Release files / adbc_driver_kinetica-7.2.2-py3-none-win_amd64.whl

Download URL adbc_driver_kinetica-7.2.2-py3-none-win_amd64.whl
Size 9.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
aae8b78eb2d3abddf1d3ec84f21001f2601a6ebd38d7ef0402ca4b493d074f82
BLAKE2b-256 checksum
How to use checksums
7ad7d645100da09dab922509cc55d58bbd7bdc9c6a24c9c1d0ead87f08ae23e2
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.2-py3-none-manylinux_2_17_x86_64.whl

Download URL adbc_driver_kinetica-7.2.2-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
ba914a7edb15ff7297ecefae9ab91fb8e041664e46ac4a57273f26826ec8148c
BLAKE2b-256 checksum
How to use checksums
b0fce0fb1e764c044ed2ce39d07b6cd4e7dc8a34d2204c641723036e9b5b2850
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.2-py3-none-manylinux_2_17_aarch64.whl

Download URL adbc_driver_kinetica-7.2.2-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
9a0c1c035e10fab6249dfe8fce60c16b3e0cde4e25047567d364a687d611e20a
BLAKE2b-256 checksum
How to use checksums
419caae72a11b2d66ee7e4703377c912181d713bc607321ad0716da51c138b0b
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.2-py3-none-macosx_13_0_arm64.whl

Download URL adbc_driver_kinetica-7.2.2-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
aa0d29d72f3767b333c6544e659e455ef72eccad2647f8bfb5e67931d55b5b90
BLAKE2b-256 checksum
How to use checksums
e61956e4ca2195d53d766dabe4b9853bb23e233f5bba7853237ab9aada89e439
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.2

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.

Release history Release notifications | RSS feed

This release

7.2.2 This release

4 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page