PrestoDB Platform Guide
PrestoDB is Meta’s distributed SQL query engine (the original Presto project). BenchBox provides a dedicated PrestoDB adapter that intentionally diverges from the Trino adapter to respect protocol, driver, and dialect differences between the two forks.
Overview
Type: Distributed SQL query engine
Common Use Cases: Legacy Presto clusters, Meta ecosystem deployments, Presto-compatible managed services
BenchBox Extra: uv add benchbox --extra presto
Driver-only install: python -m pip install presto-python-client
Why a Separate Adapter (Not Shared With Trino)
- Driver API: PrestoDB uses
presto-python-client(prestodbimport) while Trino uses thetrinopackage. Cursor semantics and auth helpers differ. - Protocol Headers: PrestoDB sends
X-Presto-*headers; Trino sendsX-Trino-*. Mixing them causes authentication failures. - Dialect: SQLGlot exposes a dedicated
prestodialect. Trino inherits from it but overrides functions (LOG base order, TRIM handling, JSON behavior, LISTAGG rules). - System Metadata: System schemas diverge (e.g., runtime tables, connector properties), so platform info queries cannot be shared.
The adapter follows the recommended path of keeping PrestoDB and Trino isolated for clarity and maintainability.
SQL Dialect Notes (SQLGlot)
- PrestoDB uses the
prestodialect identifier (adapter.get_target_dialect()returns"presto"). - Function differences vs Trino include:
LOGargument order (base-first), distinct from Trino’s overrideTRIM,JSON_QUERY, andLISTAGGparsing- Array and aggregation transforms (e.g.,
ArraySum,GroupConcat,Merge) use Presto-specific rewrites
- Use this adapter when you need PrestoDB-specific query rendering; use the Trino adapter for Trino/Starburst workloads.
Quick Start
Install the Presto extra (includes presto-python-client and cloudpathlib):
uv add benchbox --extra prestofrom benchbox.platforms.presto import PrestoAdapterfrom benchbox import TPCH
adapter = PrestoAdapter( host="presto-coordinator.example.com", port=8080, catalog="hive", schema="default", username="presto",)
benchmark = TPCH(scale_factor=1.0)results = benchmark.run_with_platform(adapter)
print(f"Completed in {results.duration_seconds:.2f}s")The adapter also accepts an optional password for basic auth.
CLI Usage
The CLI reads connection settings from the presto section of ~/.benchbox/credentials.yaml. Values written as ${VAR} are read from the environment:
presto: host: presto-coordinator.example.com port: 8080 username: presto password: ${PRESTO_PASSWORD} schema: defaultThen choose the catalog on the command line:
benchbox run --platform presto --benchmark tpch --scale 1.0 \ --platform-option catalog=hiveThe catalog, table_format, staging_root, and source_catalog settings are platform options. When schema is not set, BenchBox generates a schema name from the benchmark and scale factor.
Configuration Highlights
- Connection:
host,port(default8080),catalog,schema - Authentication: Basic auth via
presto-python-client, usingusernameandpasswordfrom the credentials file; Kerberos is not supported - Protocol:
http_schemeauto-selectshttpswhen a password is provided; SSL verification is configurable viaverify_sslorssl_cert_path - Dialect: Hard-coded to
"presto"to avoid Trino behavior - Session Properties: Can be set via
session_propertiesmapping (applied after connect withSET SESSION) - Data Loading: Uses batch
INSERTstatements with small batches tuned for PrestoDB; supports memory or Hive catalogs
When to Choose PrestoDB vs Trino vs Amazon Athena
- PrestoDB: Existing Presto deployments, Meta ecosystem, or environments pinned to Presto-only features.
- Trino: Recommended default for modern clusters and Starburst Enterprise.
- Amazon Athena: AWS-managed Presto/Trino lineage with serverless execution.