> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/build/productize/connect-engine/trino/minerva.md).

# Minerva

Connect Vulcan to DataOS Minerva, a shared Trino-compatible cluster managed by DataOS.

Minerva is a Trino-compatible query cluster that DataOS runs and manages in your tenant. Use this path when a Minerva cluster already exists and Vulcan only needs to connect to it. You don't provision anything: you point Vulcan at the running cluster and authenticate with a DataOS Secret. This page covers the connection. For the full reference, see the [Trino engine manual](https://v2.dataos.info/references/engine-guide/trino-1/minerva-1) in References.

## Before you start

You need a running Minerva cluster and its details:

* Cluster name, for example `minerva-cluster`.
* Host, for example `tcp.<env-name>.dataos.cloud`, and port, commonly `7432`.
* Catalog name, for example `s3depot`.
* Your DataOS user ID, API key, and tenant name, to generate a Minerva password: a base64-encoded JSON object with 3 fields, `cluster`, `apikey`, and `tenant`.

{% tabs %}
{% tab title="macOS and Linux" %}

```bash
echo -n '{"cluster":"<cluster>","apikey":"<api-key>","tenant":"<tenant>"}' | base64 | tr -d '\n'
```

{% endtab %}

{% tab title="PowerShell" %}

```powershell
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('{"cluster":"<cluster>","apikey":"<api-key>","tenant":"<tenant>"}'))
```

{% endtab %}

{% tab title="Command Prompt" %}
Command Prompt has no built-in base64 encoder. Use `certutil`, then strip its header, footer, and line breaks:

```bat
echo {"cluster":"<cluster>","apikey":"<api-key>","tenant":"<tenant>"}> payload.json
certutil -encode payload.json payload.b64
type payload.b64
```

`certutil -encode` wraps the output in `-----BEGIN CERTIFICATE-----` / `-----END CERTIFICATE-----` lines and inserts line breaks every 64 characters. Open `payload.b64`, remove those two header/footer lines, and join the remaining lines into one string before using it as the password. PowerShell is the simpler option on Windows.
{% endtab %}
{% endtabs %}

Confirm the cluster exists:

```bash
dataos-ctl resource get -t minerva -a
dataos-ctl resource get -t minerva -n <minerva-cluster-name>
```

## Permissions

The Minerva user needs `USE` on the source and target catalogs, `CREATE SCHEMA` on the target catalog if Vulcan creates the schema, `SELECT` on source tables and views, and `CREATE TABLE`, `CREATE VIEW`, `SELECT`, `INSERT`, `DELETE`, `DROP TABLE`, `DROP VIEW`, and `ALTER TABLE` on the target schema.

## 1. Create and project the Secret

Store the user ID and the generated password in a Secret:

```yaml
name: trino-connection-secret
version: v2alpha
type: secret
layer: user
secret:
  type: key-value
  data:
    USER_ID: "<dataos-user-id>"
    PASSWORD: "<base64-json-password>"
```

Apply it, then project the values into the environment variables `config.yaml` reads. The projection lives under `deployment:` in `config.yaml`, alongside the rest of your deploy settings:

```yaml
deployment:
  use:
    secrets:
      - { id: <tenant>:trino-connection-secret, context_alias: trn }
    env_vars:
      - key: TRINO_USER
        template: "{{ secrets['trn'].USER_ID | base64_decode }}"
      - key: TRINO_PASSWORD
        template: "{{ secrets['trn'].PASSWORD | base64_decode }}"
```

## 2. config.yaml (for local)

```yaml
vde: false
gateways:
  default:
    connection:
      type: trino
      host: "tcp.<env-name>.dataos.cloud"
      port: 7432
      user: "{{ env_var('TRINO_USER') }}"
      catalog: "s3depot"
      http_scheme: https
      method: basic
      password: "{{ env_var('TRINO_PASSWORD') }}"
      verify: true
    state_connection:
      type: duckdb              # local dev only
      database: ./.state.db
default_gateway: default
model_defaults:
  dialect: trino
  start: "2024-01-01"
ignore_patterns:
  - "*-deploy.yaml"
```

{% hint style="warning" %}
`TRINO_PASSWORD` is typically a long, DataOS-issued API key, not a literal password. Confirm the secret's password field carries the full key string: a placeholder or truncated value fails auth with no clearer error.
{% endhint %}

## Supported model kinds

Minerva supports only the `VIEW` model kind. `FULL`, `SEED`, `INCREMENTAL_BY_TIME_RANGE`, and `INCREMENTAL_BY_PARTITION` require a dedicated Trino cluster. See the [Trino engine manual](https://v2.dataos.info/references/engine-guide/trino-1/minerva-1).

## Before you plan

Confirm:

* `vde: false`, `connection.type: trino`, and `model_defaults.dialect: trino` are set.
* The host, port, user, catalog, and password are all set.
* The Secret is applied and projected.
* The user can create schemas, tables, and views in the target catalog.

Validate locally with `vulcan migrate`, then `vulcan plan` (a dry run — expect your `VIEW` models staged), then `vulcan run`.

## Deploying

There's no cluster to size, JVM to tune, or plugin directory to manage — Minerva is already running. The gateway shape carries straight into production unchanged. Deploy settings live under `deployment:` in `config.yaml`, with no `deployment.trino` block; `vulcan create_deploy_yaml` renders the resource, and the `deployment.use` projection re-injects the same connection env vars from the Secret instead of your shell exporting them. Drop `state_connection` before deploying, since DataOS provisions the state store automatically. Keep `ignore_patterns: ["*-deploy.yaml"]` so a rendered deploy manifest is never parsed as a model.

## Troubleshooting

| Symptom                                      | Likely cause                                                                       | Fix                                                                                         |
| -------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `vulcan plan` works locally, fails in DataOS | Wrong catalog/schema permission on Minerva, or an env var not projected correctly  | Verify with `SHOW CATALOGS`; check the projected secret values.                             |
| Catalog present but queries fail             | Missing credentials or permission that only surfaces on access                     | `SHOW SCHEMAS FROM <catalog>;` then a 1-row `SELECT`; ask your platform team to fix grants. |
| Auth failure connecting to Minerva           | `TRINO_PASSWORD` treated as a literal password instead of the DataOS API key it is | Confirm the secret's password field carries the full API key string.                        |
| Production `vulcan migrate` fails            | Platform-managed state store not provisioned or unreachable                        | Escalate to the SRE/platform team, then re-run `vulcan migrate`.                            |

For the full hello-world walkthrough, production deploy example, and failure-mode table, see [Minerva](https://v2.dataos.info/references/engine-guide/trino-1/minerva-1) in the Trino engine manual.

Then continue to [Assets](https://v2.dataos.info/build/productize/assets.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://v2.dataos.info/build/productize/connect-engine/trino/minerva.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
