Trino ADB connector overview
Connecting to an ADB cluster through the Trino connector begins with creating a new Trino catalog.
The catalog configuration must use the greengagedb connector type and must contain the following set of properties (at minimum):
connector.name=greengagedb (1)
connection-url=jdbc:postgresql://<adb_master>:5432/database (2)
connection-user=<adb_username> (3)
connection-password=<password>
| 1 | Sets the connector type to work with ADB.
Starting with ADH 4.2.0, two interchangeable connector names are allowed: connector.name=greengagedb or connector.name=adb. |
| 2 | Sets the JDBC connection string to connect to the ADB server. The connector uses the PostgreSQL JDBC driver and supports all its configuration properties as well as inherits its limitations. For more information, see Trino PostgreSQL connector. |
| 3 | Specifies the ADB user to connect to ADB. The user must be pre-created on the ADB side and must have sufficient permissions to perform operations in the ADB cluster. |
Connector operating modes
The Trino connector can interact with an ADB cluster in several modes described below.
| Mode | Read | Write | Description |
|---|---|---|---|
JDBC |
Yes |
Yes |
The default mode for communication between the connector and an ADB cluster via a JDBC driver. Does not support parallel read/write operations and other optimizations. This is the slowest, however, the most reliable mode, which works when other modes cannot be used |
gpfdist |
Yes |
Yes |
gpfdist is a file distribution utility that allows loading and unloading data in parallel from external ADB tables. Under the hood, the Trino connector spins up gpfdist servers on ADH hosts, and ADB segments use gpfdist clients to exchange data with the Trino connector in parallel. This communication mode is enabled by setting the |
Parallel cursor |
Yes |
No |
The |
Enable the parallel cursor mode
To activate the parallel cursor mode, do the following:
-
In the ADB cluster, create the
gp_parallel_retrieve_cursorextension:CREATE EXTENSION gp_parallel_retrieve_cursor; -
When creating a new Trino catalog for ADB, set the
greengagedb.read-mode=PARALLEL_CURSORparameter (greengagedb.read_mode=PARALLEL_CURSORsession parameter).
|
IMPORTANT
To use the parallel cursor mode, the greengagedb.scan-parallelism parameter value must be SEGMENTS (default value).
|
Mode selection logic and JDBC fallback
Read mode selection
The connector read mode is specified using the greengagedb.read-mode parameter which accepts the following values:
-
PARALLEL_CURSOR -
GPFDIST -
JDBC -
AUTO
The following table provides implementation details for each mode.
| Read mode | Implementation details |
|---|---|
PARALLEL_CURSOR |
Used only if specified explicitly |
GPFDIST |
If any selected column is not gpfdist-supported, reading through gpfdist is skipped and JDBC is used |
JDBC |
Used as a fallback communication mode. The fallback rules are as follows:
|
AUTO |
If |
Operations support
SQL support
The following table lists SQL operations supported on the connector level.
| Operation | Is supported | Note |
|---|---|---|
SELECT |
Yes |
The read mode is selected based on the |
INSERT / CTAS |
Yes |
Insert using gpfdist if |
UPDATE / DELETE / MERGE |
Yes |
DML commands are executed via JDBC |
CREATE/DROP TABLE, CREATE/DROP SCHEMA, RENAME SCHEMA |
Yes |
DDL commands are executed via JDBC |
ALTER TABLE, ADD/DROP/RENAME COLUMN |
Yes |
DDL commands are executed via JDBC |
ALTER COLUMN TYPE / DROP NOT NULL |
Yes |
DDL commands are executed via JDBC |
Supported modes for SELECT
The following table describes supported read modes for SELECT operations.
| Operation type | JDBC | Parallel cursor | gpfdist |
|---|---|---|---|
Named table scan |
Yes |
Yes |
Yes |
Query relation handle (pushed query/join relation) |
Yes |
JDBC is forced |
JDBC is forced |
ORDER BY + LIMIT requiring global order |
Yes |
JDBC is forced |
JDBC is forced |
LIMIT pushdown |
Yes |
Yes (single split) |
Yes (single split) |
Unsupported gpfdist column types |
N/A |
N/A |
Fallback to JDBC ( |
|
Yes |
JDBC is forced |
JDBC is forced |
Pushdown support
| Feature | JDBC read | Parallel cursor read | gpfdist read |
|---|---|---|---|
Predicate/projection |
Yes |
Yes |
Yes |
Aggregation |
Yes |
Yes |
Yes |
Join |
Yes |
Yes
|
Yes
|
ADB migration to Greengage
In ADH 4.2.0, the Trino ADB connector was updated due to the migration of ADB to GreengageDB. This update resulted in following major changes:
-
A new Trino ADB connector name is used —
connector.name=greengagedb. Theconnector.name=adbcan also be used for backward compatibility. -
Connector configuration parameters were changed.
If you use Trino ADB connector and plan to upgrade to ADH 4.2.0, perform the upgrade steps in following order:
-
Stop the Trino service before upgrading.
-
Update the connector configuration according to the new configuration parameters.
-
Run the cluster upgrade.
Limitations and features
The Trino ADB connector has the following features and limitations:
-
Parallel cursor requires the
gp_parallel_retrieve_cursorGreengageDB extension. -
The gpfdist mode requires network reachability from all active segments to the Trino gpfdist endpoint.
-
The gpfdist health endpoint is available at http://<external-host>:<port>/health.
-
ALTER TABLE … ADD COLUMNdoes not supportFIRST/AFTERand column comments. -
Cross-schema table rename is not supported.
-
__trino_row_idis optional and is disabled by default. To enable generation of this ID for tables created by the connector, setgreengagedb.trino-row-id-enabled=true. -
ADB 7.x (Greengage DB 7.x) is temporarily unsupported.