Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

5.0 KB
Raw Blame

title: "Trino Connector SQL Support" slug: "/trino-connector/sql-support" keyword: "gravitino connector trino" license: "This software is licensed under the Apache License version 2."

Introduction

The connector provides read access and write access to data and metadata stored in Apache Gravitino.

Globally Available Statements

Read Operations

Write Operations

Schema and Table Management

When a CREATE TABLE AS SELECT statement fails, the connector drops the table that the statement created, except for Hive managed tables (see Hive catalog). If the drop fails, the coordinator logs a warning and the table stays. The table is visible to other queries while the statement runs. If another query writes to it or recreates it and the statement then fails, the connector still drops the table.

View Management

View management is only supported for catalogs backed by Hive or Iceberg; other catalogs (e.g. Glue, JDBC, Memory) do not support view operations. A view stored by Gravitino may carry SQL representations for multiple engines (Hive, Spark, Flink, Trino); the Trino connector only reads and writes the Trino dialect representation. A view that has no Trino SQL representation is silently invisible to Trino (it does not appear in SHOW TABLES/information_schema and cannot be loaded), rather than causing an error. View owner (SECURITY DEFINER/SECURITY INVOKER) is persisted and reloaded via a reserved internal property; for Hive-backed catalogs this round-trips through Trino's native "Presto View" Hive Metastore format, with the live Hive Metastore table owner taking precedence over a possibly-stale owner encoded in that payload. The SQL path (SET PATH) and view-level WITH (...) properties are not supported: a view with a non-empty path is rejected rather than silently discarding it, and a WITH (...) clause on CREATE VIEW is rejected because no view property is registered.

Some catalogs (e.g. Iceberg) can store a view with a default schema but no default catalog. In single-metalake mode this is resolved against the current Trino catalog. In multi-metalake mode it cannot be resolved reliably, so loading such a view fails with an error instead of silently resolving to a possibly incorrect catalog.

For Hive-backed catalogs, Trino dialect views are stored using Trino's own native "Presto View" Hive Metastore format, so views are interoperable with a native Trino (or Presto) Hive connector pointed at the same Hive Metastore: a view created directly through a native Trino Hive connector is visible and queryable through Gravitino, and a view created through Gravitino is visible and queryable through a native Trino Hive connector.

Transactions

For more information, refer to Trino SQL statements support