Summary
I'd like to propose adding a Presto (PrestoDB) driver to the ADBC Driver
Foundry, following the same pattern as the existing Trino
driver: a standalone repo built on
driverbase-go, wrapping a database/sql client
(prestodb/presto-go-client/v2)
via sqlwrapper.
I've built a working prototype at
https://github.com/jja725/adbc-presto by porting the Trino driver's
structure over to the Presto client, and would like to either transfer this
repo into the org (e.g. as adbc-drivers/presto) or use it as the basis for
a fresh PR into a new org repo, whichever the maintainers prefer.
Status
- Mirrors the
adbc-drivers/trino layout: driver core, db_factory.go,
catalog/schema/statistics introspection, error mapping, cgo shared-library
packaging (pkg/), a docker-compose + pytest validation suite, and CI
workflow templates adapted from adbc-drivers/dev.
- Builds and passes
go vet/gofmt cleanly, plus the cgo shared library
(-tags driverlib -buildmode=c-shared).
- Full Go integration suite (validation + driver-specific tests, 85 cases)
passes against prestodb/presto:latest (0.298) in Docker.
Notable differences from the Trino driver (why this isn't just a rename)
- No
current_catalog/current_schema SQL functions in PrestoDB, and
the Go client doesn't apply X-Presto-Set-Catalog/Schema response
headers to its session. The driver tracks the current namespace itself
(validated against system.metadata.catalogs /
information_schema.schemata) and applies it to new pooled connections
via presto.WithSessionSetup.
- PrestoDB does not narrow INSERT literals (e.g. an
INTEGER literal
is rejected for a TINYINT column), so the ingest path wraps
TINYINT/SMALLINT/REAL/DECIMAL/TIME/DATE/TIMESTAMP WITH TIME ZONE
parameters in explicit CASTs.
- Presto
TIMESTAMP/TIME have fixed millisecond precision (no
parameterized precision like Trino), and the client exposes no
precision/scale/nullability column metadata, so DECIMAL maps to
string and ARRAY/MAP/ROW map to JSON strings.
SHOW STATS has an extra histogram column in PrestoDB; the scan
tolerates either column count.
- Error mapping targets
presto.QueryError (ErrorType/ErrorName/code
ranges) and HTTP-level presto.ErrorResponse, since PrestoDB doesn't
return SQLSTATE.
Open questions for maintainers
- Preferred path: transfer
jja725/adbc-presto into the org, or open a PR
against a freshly-created empty adbc-drivers/presto repo?
- Module path / driver naming conventions to follow exactly (I used
github.com/adbc-drivers/presto, driver name presto, matching the
adbc-drivers/trino conventions).
- Any preference on how a PrestoDB driver should relate to the existing
presto-go-client/v2's dual Presto/Trino support — I kept this driver
PrestoDB-only and left Trino on trino-go-client in the existing driver,
since the latter has richer Trino-specific features (typed array
scanning, progress callbacks, prepared statements) that the shared
client doesn't provide.
Happy to open the PR once there's a repo to target, or adjust the structure
based on feedback here first.
Summary
I'd like to propose adding a Presto (PrestoDB) driver to the ADBC Driver
Foundry, following the same pattern as the existing Trino
driver: a standalone repo built on
driverbase-go, wrapping adatabase/sqlclient(
prestodb/presto-go-client/v2)via
sqlwrapper.I've built a working prototype at
https://github.com/jja725/adbc-presto by porting the Trino driver's
structure over to the Presto client, and would like to either transfer this
repo into the org (e.g. as
adbc-drivers/presto) or use it as the basis fora fresh PR into a new org repo, whichever the maintainers prefer.
Status
adbc-drivers/trinolayout: driver core,db_factory.go,catalog/schema/statistics introspection, error mapping, cgo shared-library
packaging (
pkg/), a docker-compose + pytest validation suite, and CIworkflow templates adapted from
adbc-drivers/dev.go vet/gofmtcleanly, plus the cgo shared library(
-tags driverlib -buildmode=c-shared).passes against
prestodb/presto:latest(0.298) in Docker.Notable differences from the Trino driver (why this isn't just a rename)
current_catalog/current_schemaSQL functions in PrestoDB, andthe Go client doesn't apply
X-Presto-Set-Catalog/Schemaresponseheaders to its session. The driver tracks the current namespace itself
(validated against
system.metadata.catalogs/information_schema.schemata) and applies it to new pooled connectionsvia
presto.WithSessionSetup.INTEGERliteralis rejected for a
TINYINTcolumn), so the ingest path wrapsTINYINT/SMALLINT/REAL/DECIMAL/TIME/DATE/TIMESTAMP WITH TIME ZONE
parameters in explicit
CASTs.TIMESTAMP/TIMEhave fixed millisecond precision (noparameterized precision like Trino), and the client exposes no
precision/scale/nullability column metadata, so
DECIMALmaps tostring and
ARRAY/MAP/ROWmap to JSON strings.SHOW STATShas an extrahistogramcolumn in PrestoDB; the scantolerates either column count.
presto.QueryError(ErrorType/ErrorName/coderanges) and HTTP-level
presto.ErrorResponse, since PrestoDB doesn'treturn SQLSTATE.
Open questions for maintainers
jja725/adbc-prestointo the org, or open a PRagainst a freshly-created empty
adbc-drivers/prestorepo?github.com/adbc-drivers/presto, driver namepresto, matching theadbc-drivers/trinoconventions).presto-go-client/v2's dual Presto/Trino support — I kept this driverPrestoDB-only and left Trino on
trino-go-clientin the existing driver,since the latter has richer Trino-specific features (typed array
scanning, progress callbacks, prepared statements) that the shared
client doesn't provide.
Happy to open the PR once there's a repo to target, or adjust the structure
based on feedback here first.