Skip to main content

Supported catalogs

The sources Trino supports through the connector are listed in Supported sources. Each catalog is backed by the corresponding Trino connector and behaves the way that connector behaves, so that connector must be installed in Trino. The difference is that catalogs come from Gravitino rather than from a properties file.

Manage catalogs​

Three stored procedures live under the gravitino connector in the system schema. Both positional and named arguments work.

Catalog management procedures
create_catalog(CATALOG varchar, PROVIDER varchar, PROPERTIES MAP(VARCHAR, VARCHAR), IGNORE_EXIST boolean);
drop_catalog(CATALOG varchar, IGNORE_NOT_EXIST boolean);
alter_catalog(CATALOG varchar, SET_PROPERTIES MAP(VARCHAR, VARCHAR), REMOVE_PROPERTIES ARRAY[VARCHAR]);

PROVIDER is the provider name given for each catalog type below. IGNORE_EXIST and IGNORE_NOT_EXIST are optional and default to false.

Create a MySQL catalog
CALL gravitino.system.create_catalog(
'mysql_catalog',
'jdbc-mysql',
map(
array['jdbc-url', 'jdbc-user', 'jdbc-password', 'jdbc-driver'],
array['jdbc:mysql://{host}:3306?useSSL=false', '{user}', '{password}', 'com.mysql.cj.jdbc.Driver']
)
);

Catalog properties are documented with each catalog type, linked from its section below. SELECT * FROM gravitino.system.catalog lists what is registered.

Trino connector settings pass through with a trino.bypass. prefix on the property key. Settings the Trino connector inherits from the Gravitino catalog cannot be overridden this way: the MySQL connector takes connection-url, connection-user, and connection-password from the catalog's jdbc-url, jdbc-user, and jdbc-password, so a trino.bypass.connection-url is silently ignored.

Hive​

The provider name is hive, and catalog properties are on the Hive catalog page.

Requires a Hive metastore or a compatible implementation, reachable from the coordinator and every worker, with Thrift on port 9083 by default. HDFS 2.x is supported, along with S3 and S3-compatible systems, GCS, Azure Storage, and IBM Cloud Object Storage. Files must be ORC, Parquet, Avro, RCFile, SequenceFile, JSON, CSV, or text.

Schemas take a location property. Tables take format (default TEXTFILE), location, input_format, output_format, serde_lib, serde_name, partitioned_by, bucketed_by, bucket_count, and sorted_by. Four more are set by Gravitino and readable but not settable: total_size, num_files, external, and table_type.

The HDFS client is configured from catalog properties, with hdfs-site.xml and core-site.xml supplied through trino.bypass.hive.config.resources. Before any INSERT, confirm the user Trino runs as can write to the warehouse directory, overriding it with -DHADOOP_USER_NAME={user} in the Trino JVM configuration if needed.

When the catalog has a credential provider that issues an S3 key pair or an Azure account key, the connector requests it from the server and passes it to Trino. Otherwise S3 settings pass through as trino.bypass.hive.s3.aws-access-key, trino.bypass.hive.s3.aws-secret-key, and trino.bypass.hive.s3.region. The metastore behind the catalog has to support S3 itself.

Iceberg​

The provider name is lakehouse-iceberg, and catalog properties are on the Iceberg catalog page.

Iceberg catalogs reach Trino through the Gravitino Iceberg REST service by default, whatever backend the catalog uses, and storage credentials are vended per table. The catalog needs credential vending configured, and every Trino node needs the service address and its own authentication; see Iceberg REST routing. Files must be ORC or Parquet, Parquet by default.

Schemas take no properties. Tables take partitioning and sorted_by.

Maintenance is delegated to the Iceberg connector through ALTER TABLE ... EXECUTE: expire_snapshots, remove_orphan_files, optimize, and rewrite_manifests. Expiring below the default retention threshold requires the minimum retention override to be set at or below the requested value. Parameters are in the Trino Iceberg documentation.

With gravitino.iceberg.rest-routing-enabled=false, the connector instead registers a Hive-backed catalog as Trino's hive_metastore type and a JDBC-backed one as its jdbc type. That path takes static storage keys only: the connector requests the catalog's credentials from the server and passes an S3 key pair or an Azure account key to Trino itself.

MySQL​

The provider name is jdbc-mysql, and catalog properties are on the MySQL catalog page.

MySQL 5.7 or 8.0 and later, port 3306 by default. Schemas take no properties.

CREATE TABLE accepts columns, nullability, comments, primary keys, indexes, default values, and auto-increment.

Tables take engine (default InnoDB), auto_increment_offset, primary_key whose columns must all be NOT NULL, and unique_key, each written as keyName:col1,col2. Columns take auto_increment and default.

Only constant defaults are supported, not expressions, and SHOW CREATE TABLE renders only constants. Defaults are accepted on TINYINT, SMALLINT, INT, BIGINT, REAL, DOUBLE, DECIMAL, VARCHAR, CHAR, DATE, TIME, and TIMESTAMP.

PostgreSQL​

The provider name is jdbc-postgresql, and catalog properties are on the PostgreSQL catalog page.

PostgreSQL 10.x or later, port 5432 by default. Tables and schemas take no properties.

CREATE TABLE accepts columns, nullability, and comments. Primary keys, indexes, default values, and auto-increment are not supported.

PostgreSQL folds unquoted identifiers to lowercase, so MyTable and MYTABLE both resolve to mytable, while an identifier created with quotes keeps its case and must be quoted thereafter. Use unquoted identifiers with this connector; names containing uppercase letters may not be found otherwise.

Oracle and SQL Server​

The provider names are jdbc-oracle and jdbc-sqlserver, and catalog properties are on the Oracle catalog and SQL Server catalog pages.

An Oracle catalog runs on Trino's oracle connector and a SQL Server catalog on Trino's sqlserver connector, with the connection URL and credentials taken from the catalog's jdbc-url, jdbc-user, and jdbc-password. Identifier case, type mapping, and supported changes follow the Oracle and SQL Server catalog pages.

AWS Glue​

The provider name is glue, and catalog properties are on the Glue catalog page.

Requires network access to the Glue API and S3, IAM credentials with Glue and S3 permissions as described on the Glue catalog page, and data on S3.

Tables default to Hive format. Setting type = 'ICEBERG' creates an Iceberg table and unlocks Iceberg's partition transforms in partitioned_by: identity, year, month, day, hour, bucket(column, N), and truncate(column, W).

Schemas take location. Tables take type (HIVE or ICEBERG), format, location which defaults to a path derived from the catalog warehouse, partitioned_by, and for Hive format bucketed_by, bucket_count, and sorted_by. bucket_count is required when bucketed_by is set. Glue has no rename API, so a Hive-format table cannot be renamed.

CREATE OR REPLACE TABLE AS SELECT is not supported. Drop and recreate instead.

Type mapping​

Gravitino typeTrino type
BooleanBOOLEAN
ByteTINYINT
ShortSMALLINT
IntegerINTEGER
LongBIGINT
FloatREAL
DoubleDOUBLE
DecimalDECIMAL
String, VarcharVARCHAR
FixedCharCHAR
BinaryVARBINARY
DateDATE
TimeTIME
TimestampTIMESTAMP
TimestampWithTimezoneTIMESTAMP WITH TIME ZONE
ListARRAY
MapMAP
StructROW

A given provider may not support every row. Hive has no TIME type, for example.

Supported operations​

Every catalog supports CREATE SCHEMA, CREATE TABLE, CREATE TABLE AS SELECT, SELECT, INSERT, DROP TABLE, and DROP SCHEMA. Changing tables and rows depends on the catalog.

CatalogALTER TABLEUPDATEDELETEMERGE
HiveRename table, add, drop, and rename columns, change a column type, set a propertyTransactional ORC tables only, not on partition or bucket columnsWhole partitions on non-transactional tables; any rows on transactional ORC tablesACID tables only
IcebergRename table, add, drop, and rename columns, change a column type, set a propertyFormat version 2 or laterPartitions and rows, format version 2 or laterFormat version 2 or later
MySQLRename table, add and drop columns, change a column type, set a propertyConstant assignments and predicates onlyMatching rows, or every row without a WHERE clauseNot supported
PostgreSQLRename table, add, drop, and rename columns, change a column type, set a propertyConstant assignments and predicates onlyMatching rows, or every row without a WHERE clauseNot supported
AWS GlueAdd, drop, and rename columns, change a column type, set a property; rename Iceberg tables onlyIceberg tables only, format version 2 or laterWhole partitions on Hive-format tables; any rows on Iceberg tablesAs Hive or Iceberg, by table type

Further limits are in Trino's documentation for the Hive, Iceberg, MySQL, and PostgreSQL connectors. Oracle and SQL Server follow Trino's oracle and sqlserver connectors.