Trino ADB connector configuration

This article describes configuration parameters supported by the Trino connector for ADB. The parameters are set when creating a Trino catalog for working with an ADB cluster. The parameters can be specified using ADCM or within the WITH clause, for example:

CREATE CATALOG test_adb_catalog USING greengagedb
WITH (
  "connection-url" = 'jdbc:postgresql://<adb_master>:5432/trino',
  ...
  "<configuration_param1>" = "<value1>",
  "<configuration_param2>" = "<value2>"
);

Common parameters

Configuration parameter Description Default value

greengagedb.array-mapping

The type of array mapping for the array data type. Possible values: DISABLED, AS_ARRAY

DISABLED

greengagedb.experimental.enable-string-pushdown-with-collate

Enables string pushdown with collate

false

greengagedb.fetch-size

The maximum number of rows to fetch. If not set, the value is calculated using the formula:

 — 

greengagedb.geography-enabled

Enables Geography/SphericalGeography features

false

greengagedb.geospatial-aggregate-pushdown-enabled

Enables geospatial aggregate pushdowns

true

greengagedb.geospatial-pushdown-enabled

Enables geospatial predicate/projection/join pushdowns

true

greengagedb.include-system-tables

Indicates whether to include system tables

false

greengagedb.max-splits

The maximum number of splits

 — 

greengagedb.pushdown-decimal-arithmetic-enabled

Enables decimal arithmetic pushdowns

false

greengagedb.pushdown-double-arithmetic-enabled

Enables floating point arithmetic pushdowns

false

greengagedb.pushdown-function-datetime-enabled

Enables safe date/time scalar function pushdowns

false

greengagedb.pushdown-function-string-enabled

Enables safe string scalar function pushdowns

false

greengagedb.read-fallback

Allows or forbids the fallback to the JDBC read mode. Possible values:

  • ALLOW

  • FORBID

ALLOW

greengagedb.read-mode

Specifies the read mode from an ADB cluster. Possible values:

  • AUTO

  • JDBC

  • PARALLEL_CURSOR

  • GPFDIST

AUTO

greengagedb.scan-parallelism

Indicates whether scanning should be parallelized across segments. Possible values:

  • SINGLE

  • SEGMENTS

SEGMENTS

greengagedb.system-schemas

Indicates whether to include system schemas. Values ending with _ are treated as prefixes

 — 

greengagedb.trino-row-id-enabled

If enabled, the connector adds the __trino_row_id column to the tables created by the connector. Examples of when this option should be enabled:

  • When you plan to run UPDATE/DELETE/MERGE operations via the Trino connector on tables that may not have a reliable primary key.

  • When you want a stable connector-managed row identifier instead of relying on physical row identifiers.

When to keep disabled:

  • Tables already have proper primary keys used for DML operations.

  • The workload is primarily append-only analytics (SELECT/INSERT operations) and an extra synthetic column is unwanted.

false

gpfdist parameters

Configuration parameter Description Default value

greengagedb.gpfdist.enabled

Enables gpfdist for read/insert operations

true

greengagedb.gpfdist.external-table-schema

Specifies a schema for temporary external tables

public

greengagedb.gpfdist.statement-timeout

gpfdist read SQL timeout. Used for external table DDL operations and unload queries

3600s

greengagedb.gpfdist.transfer-timeout

gpfdist transfer completion timeout. It is recommended to set this timeout more than greengagedb.gpfdist.statement-timeout, since the statement timeout limits individual SQL statements, whereas the transfer timeout limits the entire end-to-end gpfdist communication. If greengagedb.gpfdist.transfer-timeout is lower than greengagedb.gpfdist.statement-timeout, the transfer can fail earlier even when SQL is still within its timeout

3600s

greengagedb.gpfdist.log-health

Indicates whether to log gpfdist health endpoint reachability

false

gpfdist server parameters

Configuration parameter Description Default value

greengagedb.gpfdist.server.bind-address

gpfdist server bind address

0.0.0.0

greengagedb.gpfdist.server.connect-timeout

Time to wait for first gpfdist connection. Setting 0ms disables the timeout

30s

greengagedb.gpfdist.server.external-host

Host name/IP address of the gpfdist server reachable from Greengage DB segments

 — 

greengagedb.gpfdist.server.idle-timeout

Time to wait between gpfdist connections. Setting 0ms disables the timeout

30s

greengagedb.gpfdist.server.insert-block-bytes

Target serialized CSV block size for gpfdist insert operations

1MB

greengagedb.gpfdist.server.insert-buffer-bytes

Maximum size of buffered data per one gpfdist insert session

128MB

greengagedb.gpfdist.server.max-connections-per-transfer

Maximum connections per transfer. Setting 0 removes the limit

0

greengagedb.gpfdist.server.pipe-buffer-size

The size of the stream pipe buffer in bytes

1048576

greengagedb.gpfdist.server.port

gpfdist server port. Setting 0 uses an ephemeral port number

0

greengagedb.gpfdist.server.thread-pool-size

HTTP server thread pool size

16

greengagedb.gpfdist.server.https.enabled

Enables the HTTPS endpoint

false

greengagedb.gpfdist.server.https.keystore-key

Keystore password for HTTPS

 — 

greengagedb.gpfdist.server.https.keystore-path

Keystore path for HTTPS

 — 

Connector defaults for CREATE TABLE

If a configuration parameter is not specified explicitly in the WITH (…​) clause when creating a table, the following connector defaults are used.

Configuration parameter Default value

greengagedb.create-table.append-only

false

greengagedb.create-table.compression-level

 — 

greengagedb.create-table.compression-type

 — 

greengagedb.create-table.distribution

FIRST_COLUMN

greengagedb.create-table.orientation

ROW

DDL table properties

The following ADB table parameters can be set using the WITH clause of the CREATE TABLE/CREATE TABLE AS commands. If a property is specified in the WITH (…​) clause, it overrides connector defaults.

Configuration parameter Type Description

append_only

boolean

Makes a table append-only. If set to false, the connector creates a heap table

block_size

integer

Sets a block size for append-only tables in bytes. Accepts values in the range 8 KB — 2 MB, must be a multiple of 8192

checksum

boolean

Enables CRC checksum for append-only tables

column_encoding

map(varchar,array(varchar))

Specifies per-column encoding directives

compression_level

integer

Append-only compression level

compression_type

varchar

Specifies the data compression algorithm. Valid values are zlib, zstd, rle_type, and none. The actual support for specific algorithms depends on the ADB version

default_column_encoding

array(varchar)

Default encoding directives

distributed_by

array(varchar)

Specifies the columns used as hash keys for distributing the table rows across segments

distributed_randomly

boolean

Enables random distribution

distributed_replicated

boolean

Enables replicated distribution

fillfactor

integer

Heap fill factor. Value must fall in the range 10-100. Effective only if append_only=false

orientation

enum

Defines the orientation for append-only tables (row or column)

partition_by

varchar

Raw partition clause

tablespace

varchar

Specifies a tablespace

An example of setting DDL parameters for an ADB table is below.

CREATE TABLE nations (
  n_nationkey integer,
  n_name char(25),
  n_regionkey integer,
  n_comment varchar(152)
)
WITH (
  distributed_by = ARRAY['n_nationkey', 'n_regionkey'], (1)
  append_only = true, (2)
  orientation = 'column', (3)
  compression_type = 'zstd' (4)
)
1 Specifies the hash distribution by several columns.
2 Sets the append-only table type.
3 Sets the orientation to be columnar.
4 Specifies the compression using the ZSTD algorithm.

Data types mapping

When exchanging data between ADB and the Trino connector, the data types are mapped according to the following rules.

ADB to Trino types mapping

 

ADB type Trino type

BIT

BOOLEAN

BOOLEAN

BOOLEAN

SMALLINT

SMALLINT

INTEGER

INTEGER

BIGINT

BIGINT

REAL

REAL

DOUBLE

DOUBLE

NUMERIC(p, s)

DECIMAL(p, s)

DECIMAL(p, s) is an alias of NUMERIC(p, s)

CHAR(n)

CHAR(n)

VARCHAR(n)

VARCHAR(n)

ENUM

VARCHAR

BYTEA

VARBINARY

DATE

DATE

TIME(n)

TIME(n)

TIMESTAMP(n)

TIMESTAMP(n)

TIMESTAMPTZ(n)

TIMESTAMP(n) WITH TIME ZONE

MONEY

VARCHAR

UUID

UUID

JSON

JSON

JSONB

JSON

HSTORE

MAP(VARCHAR, VARCHAR)

ARRAY

DISABLED, ARRAY

For more information, see ARRAY type processing

Trino to ADB types mapping

 

Trino type ADB type

BOOLEAN

BOOLEAN

SMALLINT

SMALLINT

SMALLINT

TINYINT

INTEGER

INTEGER

BIGINT

BIGINT

REAL

REAL

DOUBLE

DOUBLE

NUMERIC(p, s)

DECIMAL(p, s) is an alias of NUMERIC(p, s)

DECIMAL(p, s)

CHAR(n)

CHAR(n)

VARCHAR(n)

VARCHAR(n)

BYTEA

VARBINARY

DATE

DATE

TIME(n)

TIME(n)

TIMESTAMP(n)

TIMESTAMP(n)

TIMESTAMPTZ(n)

TIMESTAMP(n) WITH TIME ZONE

UUID

UUID

JSONB

JSON

ARRAY

ARRAY

For more information, see ARRAY type processing

Data types for gpfdist read/insert

The following data types are supported for gpfdist data exchange:

  • boolean;

  • tinyint, smallint, integer, bigint;

  • real, double;

  • decimal(p,s);

  • varchar, char;

  • date;

  • time with and without time zone;

  • timestamp with and without time zone;

  • interval;

  • varbinary;

  • json;

  • uuid;

  • ipaddress;

  • geometry, spherical_geography;

  • array<supported_element_type>;

  • row<supported_field_types>;

  • map<varchar, varchar>.

NOTE
  • map is currently limited to map<varchar, varchar> for gpfdist.

  • gpfdist read falls back to JDBC on unsupported selected types.

  • gpfdist insert operations do not auto-fallback in case of unsupported write types, but fail instead.

JDBC type mapping

JDBC type mapping adheres to standard PostgreSQL/Greengage DB types and includes connector-specific handling for arrays, geospatial types, json/jsonb, uuid, ipaddress, intervals, and custom pushdown rewrites. Unsupported JDBC types can be controlled by using the inherited JDBC property unsupported_type_handling.

Type mapping configuration

The following configuration parameters can be used to change the type casting logic.

Configuration parameter Description Default value

unsupported-type-handling

Defines how to process columns of unsupported types. The possible values:

  • IGNORE — the column is ignored.

  • CONVERT_TO_VARCHAR — convert the column value to VARCHAR of unlimited length. The corresponding session parameter is unsupported_type_handling.

IGNORE

jdbc-types-mapped-to-varchar

Defines a list of source data types to be forcibly cast to VARCHAR of unlimited length (even if the specified type is supported by the connector). For example, jdbc-types-mapped-to-varchar=VARBINARY,UUID

 — 

DECIMAL type processing

By default, the connector throws an error for columns of the DECIMAL type without an explicit precision or scale definition. If the decimal-mapping connector configuration parameter (or the decimal_mapping session parameter) is set to allow_overflow, then columns of the DECIMAL type without explicit precision/scale will be converted to the connector DECIMAL(38,0) data type. Using the decimal-default-scale connector configuration parameter (or the decimal_default_scale session parameter), you can specify a custom scale value. The precision value is always 38.

If a DECIMAL value does not fit into the specified precision and scale without rounding, the connector throws an error. You can change this behavior by enabling automatic rounding using the decimal-rounding-mode connector parameter (or the decimal_rounding_mode session parameter). The supported rounding values are UNNECESSARY (default), UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, and HALF_EVEN. These values correspond to the rounding behavior rules as of Java 17.

ARRAY type processing

The ADB ARRAY data type does not support fixed-dimensional arrays, while the Trino connector for ADB only supports one-dimensional arrays. You can instruct the connector how to handle the ARRAY types using the greengagedb.array-mapping connector configuration parameter (the greengagedb.array_mapping session parameter). The supported values are:

  • DISABLED (default) — throws an error when processing columns of the ARRAY type.

  • AS_ARRAY — the connector treats ADB arrays as the ARRAY data type. This value is suitable for ADB arrays, which are actually one-dimensional. For a multi-dimensional array, an exception will be thrown.

Found a mistake? Seleсt text and press Ctrl+Enter to report it