Trino does not have a built-in catalog and instead provides connectors to external data sources. This allows Trino to connect to, read from and join a wide variety of data sources.
Catalogs are defined in their own resources and referenced from cluster objects. See the Concepts page for more details.
You can create a catalog using the
TrinoCatalog object as follows.
apiVersion: trino.stackable.tech/v1alpha1 kind: TrinoCatalog metadata: name: hive-catalog labels: trino: simple-trino spec: connector: hive: metastore: configMap: simple-hive-derby s3: inline: host: test-minio port: 9000 accessStyle: Path credentials: secretClass: minio-credentials # We can use configOverrides to add arbitrary properties to the Trino catalog configuration configOverrides: hive.metastore.username: trino --- apiVersion: trino.stackable.tech/v1alpha1 kind: TrinoCatalog metadata: name: iceberg labels: trino: simple-trino spec: connector: iceberg: metastore: configMap: simple-hive-derby s3: inline: host: test-minio port: 9000 accessStyle: Path credentials: secretClass: minio-credentials
metadata.name will be the name of the catalog that shows up in your Trino instance.
metadata.labels will be used by
TrinoCluster to determine the link between Trino clusters and
spec.connector.<connector> determines which connector is used.
Each connector supports a different set of attributes.
It is necessary to specify within the
TrinoCluster which catalogs it should use. Here is an example of this:
apiVersion: trino.stackable.tech/v1alpha1 kind: TrinoCluster metadata: name: simple-trino spec: image: productVersion: "428" clusterConfig: catalogLabelSelector: matchLabels: trino: simple-trino # ...
spec.catalogLabelSelector is used to fetch the list of
TrinoCatalogs used for this Trino cluster.
In this case the
iceberg catalogs will be used as they both match the
TrinoCluster can, once created, detect and use new catalogs that have been subsequently created with a matching label. This also means that it is possible to reuse a
TrinoCatalog within multiple
Trino supports lots of different connectors and we can not cover all the available connectors. In case the Trino operator does not support a specific connector, there is a fallback mechanism: The Generic.