Trino

Driver Version v0.1.0 Tested With Trino 4nn

This driver provides access to Trino , a free and open-source distributed SQL query engine.

Installation

The Trino driver can be installed with dbc :

dbc install trino

Connecting

To use the driver, provide a Trino connection string as the url option.

from adbc_driver_manager import dbapi

dbapi.connect(
  driver="trino",
  db_kwargs={
      "url": "http://user@localhost:8080?catalog=tcph&schema=tiny"
  }
)

Note: The example above is for Python using the adbc-driver-manager package but the process will be similar for other driver managers.

Feature & Type Support

Feature Support
Bulk Ingestion Create
Append
Create/Append
Replace
Temporary Table
Specify target catalog
Specify target schema
Non-nullable fields are marked NOT NULL
Catalog (GetObjects) depth=catalogs
depth=db_schemas
depth=tables
depth=columns (all)
Get Parameter Schema
Get Table Schema
Prepared Statements
Transactions

Types

Trino to Arrow

SQL Type

Arrow Type

BIGINT

int64

BOOLEAN

bool

DATE

date32[day]

DECIMAL

decimal64(10, 2)

DOUBLE PRECISION

double

INT

int32

INTERVAL DAY TO SECOND

month_day_nano_interval

INTERVAL YEAR TO MONTH

month_day_nano_interval

IPADDRESS

string

REAL

float

SMALLINT

int16

TIME

time64[us]

TIMESTAMP

timestamp[us]

TIMESTAMP WITH TIME ZONE

timestamp[us, tz=UTC]

UUID

extension<arrow.uuid>

VARBINARY

binary

VARCHAR

string

Arrow to Trino

Arrow Type Trino Type
Bind Ingest
binary VARBINARY
bool BOOLEAN
date32[day] DATE
decimal64(10, 2) DECIMAL NUMERIC
decimal128 DECIMAL
double DOUBLE PRECISION
extension<arrow.uuid> UUID
float REAL
int16 SMALLINT
int32 INT
int64 BIGINT
string IPADDRESS, VARCHAR VARCHAR
time64[us] TIME
timestamp[us, tz=UTC] TIMESTAMP WITH TIME ZONE
timestamp[us] TIMESTAMP

Previous Versions

To see documentation for the current and previous versions of this driver, see the following: