Skip to content

Warehouse analysis (beta)

Beta: Snowflake, BigQuery and Amazon Redshift are available

Warehouse analysis runs an experiment's analysis on tables in your own data warehouse instead of on events sent to Controlvar. The API below is part of the full profile and every route is x-stability: beta: its shape may still change.

Snowflake is available (see Setting up Snowflake). BigQuery is available (see Setting up BigQuery). Amazon Redshift is available (see Setting up Amazon Redshift). Amazon Athena isn't available yet. GET /api/v1/warehouse/analysis/connectors says which are available on your deployment; creating a connection of any other type answers 422 connector_disabled.

What it does

You point Controlvar at two of your own tables or views:

  • an assignment source: one row per exposure, with the unit id, the experiment key, the variant label and the time of the exposure;
  • a metric source per metric: one row per event, with the unit id and the time of the event, and for a mean metric the event's value.

Controlvar writes the SQL itself (there is no field that takes SQL), runs it as the identity you created for it, and computes the results from what comes back. A metric is one of two types:

  • a proportion: the share of exposed units that had at least one event in the conversion window, compared with Fisher's exact test, the statistics /results uses;
  • a mean: the average per exposed unit of the sum of its event values in the conversion window (0 for a unit with no event; a NULL value is ignored and counted), optionally capped per unit with cap_value, and compared with Welch's t-test. Each variant reports its mean and a confidence interval.

A metric source can be marked lower is better (lower_is_better) for a metric where a fall is the improvement, such as an error rate or churn. A run then names a treatment the winner (winning_variant_id) only for a significant decrease, where without the setting only a significant increase wins. The p-values, the intervals and relative_improvement_pct, the signed change, are the same either way. The setting belongs to the source, not to an experiment's metrics, so a source has one direction in every experiment that analyses it. Each computed metric in a run's results carries the lower_is_better it was analysed with: the source's setting when the run started, which a later edit does not change.

Every metric source stored before the setting existed reads false, which is how every earlier analysis read it. To change one, mark it, validate it again and start a new analysis; an analysis already run keeps its results. Undoing the migration that stores the setting deletes it from every source: see Upgrading and migrations.

A proportion metric's results also give each treatment its difference from the control with an interval, the interval of its relative change and its impact over its own units, as /results does on the same counts. A mean metric's results give none of these three; each treatment's p-value and relative change are reported as before.

Every run reports its sample-ratio check against the variants' traffic allocation (skipped for multi-armed bandit experiments, whose split moves on purpose).

What leaves your warehouse

No row of your data. A run returns only aggregates:

  • per variant label: the label (cut to 64 characters; at most 51 labels), the number of units, the number of converting units, and two sums;
  • per statement: the grand mean and diagnostic counts (units seen in more than one variant, rows with no unit or variant, metric rows in the window and how many matched an exposed unit);
  • the query's job id, bytes billed or elapsed time.

A preview returns counts, the number of units per variant label, and the earliest and latest time in the window. Validation reads column names and types from the warehouse's metadata; it queries no data.

The connection's role decides what can be read. Anyone who can author a source can compute aggregates, and read short text such as variant labels, over anything the connection's role can read. Grant that role only the tables and views analysis needs, and read-only access to them.

How it counts, and how that differs from /results

A unit's exposure is its first exposure in the analysis window. A unit converts when it has an event at or after that exposure and within the metric's conversion window (and before the end of the analysis window). Units seen in more than one variant are left out and counted in the diagnostics.

Without a conversion window of its own, a metric in /results counts converting users with no bound on the exposure time and no conversion window. With one (conversion_window_hours, beta, the same name, unit and range), it counts each user's events from their assignment for that many hours, end excluded (Conversion window). Each setting is its own: setting a window on one does not set it on the other. The two then agree when the hours are equal, the assignment source's first exposure of each unit is the assignment /results stores, no unit is in two variants, and the analysis window covers the whole run. They still differ in two ways: /results starts a window at the start of the second the user was assigned in, so an event earlier in that second counts there and not in the warehouse, and it counts an event only for the variant it was received in, which a warehouse table does not record.

With a window, users assigned within the window before the experiment stops never get a full window, and this cannot change after it ends. The number is not the N-day conversion rate: a change that makes people convert later can show the opposite sign, even when no window does not.

Setting up Snowflake

Controlvar signs in to Snowflake's SQL API as a user in your account, with a key pair it generates. There is no password field.

  1. In Snowflake, give Controlvar a user and a role of its own. Grant the role USAGE on the warehouse, the database and the schema, and SELECT on each table or view analysis reads, and nothing else.

    A connection whose role is ACCOUNTADMIN or another of Snowflake's built-in administrative roles is refused.

  2. Create the connection in Warehouse › Connections (ADMIN). The account is the organisation-account identifier, for example MYORG-MYACCOUNT (Snowsight › Admin › Accounts), not a locator or a URL. Saving generates the key pair and shows the statement that registers its public key, for example ALTER USER CONTROLVAR SET RSA_PUBLIC_KEY='…';. Run it as an administrator. The private key never leaves Controlvar.

  3. Test the connection. The test signs in and runs one statement that reads no table.

  4. Name tables in full in a source: DATABASE.SCHEMA.TABLE, each part as Snowflake stores it (upper case unless it was created quoted).

Every statement runs with the session time zone set to UTC and is stopped by Snowflake at the connection's query_timeout_seconds. A resource monitor on the Snowflake warehouse is a good second limit.

To replace the key, choose Generate a new key. It shows the statement that registers the new public key as RSA_PUBLIC_KEY_2; the old key keeps working until a test with the new one passes.

Setting up BigQuery

Controlvar signs in to BigQuery with a service-account key you create for it, and runs every query as a job in a project you choose.

  1. In Google Cloud, create a service account for Controlvar with these two roles only:
    • BigQuery Job User on the project that runs and pays for the queries (the connection's billing project);
    • BigQuery Data Viewer on each dataset analysis reads, granted on each dataset rather than on the project.
  2. Create a JSON key for the service account and paste it into the connection form in Warehouse › Connections (ADMIN). It is sent only in the request body and stored encrypted, and it is never shown again. A key whose token_uri is not Google's own token endpoint is refused.
  3. Set the location to where your datasets are: US, EU, or a region such as europe-west2.
  4. Set the bytes cap ("Most data a query may read"). Before each query Controlvar runs a dry run: anything that is not a single SELECT, or that would read more than the cap, is refused before it runs. The real query is also sent with the cap as its billing limit, so BigQuery stops it rather than bill more.
  5. Test the connection, then name tables in full in a source: project.dataset.table.

Every job carries the label experimently: analysis, so you can find its cost in your billing.

Setting up Amazon Redshift

Controlvar runs every statement through the Amazon Redshift Data API, as an IAM role in your AWS account that it assumes. There is no password and no secret to store, and no network path to open: calls go to the Data API's regional endpoint, redshift-data.<region>.amazonaws.com, and never to the address of your cluster or workgroup. A Redshift Serverless workgroup and a provisioned cluster both work.

Before step 1, the API needs an AWS identity. Controlvar assumes your role as the identity the API itself runs as. A deployment made with this repository's AWS CDK stacks (full profile, not the demo) gives the API's task role sts:AssumeRole on roles under the controlvar-warehouse/ path in any account. The stack's output TaskRoleArn is that role's ARN. With Docker Compose or Helm, run the API with an identity of your own (an instance profile, an IAM role for a service account, or credentials in the container's environment) and grant it sts:AssumeRole on arn:aws:iam::<your-account-id>:role/controlvar-warehouse/* and nothing wider. A deployment with no such identity answers 503 aws_identity_unavailable to a test or a run.

  1. Choose the role's name. The role must sit under the IAM path /controlvar-warehouse/, so its ARN is arn:aws:iam::<your-account-id>:role/controlvar-warehouse/<role-name>. A role ARN anywhere else is refused with 422.
  2. Create the connection in Warehouse › Connections (ADMIN): the region of your workgroup or cluster, the role's ARN, the database, and either the Serverless workgroup or the provisioned cluster's identifier with its database user. Saving generates the connection's external ID and shows it. There is no field for a password or a secret ARN, and a connection cannot be tested before it is saved.
  3. Create the role in IAM, under the path /controlvar-warehouse/. Its trust policy lets the identity the API runs as assume it, and only with the connection's external ID:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "ControlvarWithThisExternalId",
          "Effect": "Allow",
          "Principal": {
            "AWS": "<ARN of the identity the API runs as>"
          },
          "Action": "sts:AssumeRole",
          "Condition": {
            "StringEquals": {
              "sts:ExternalId": "<the external ID shown on the connection>"
            }
          }
        }
      ]
    }
    

    A role whose trust policy lets the API assume it without that external ID is refused (role_trust_unsafe).

    Give the role this permissions policy. A Serverless workgroup needs ServerlessSignIn and a provisioned cluster needs ClusterSignIn: delete the statement for the shape you do not use. The workgroup in the first Resource list is named by its ID, not its name.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "RunInTheWarehouse",
          "Effect": "Allow",
          "Action": [
            "redshift-data:BatchExecuteStatement",
            "redshift-data:DescribeTable"
          ],
          "Resource": [
            "arn:aws:redshift-serverless:<region>:<your-account-id>:workgroup/<workgroup-id>",
            "arn:aws:redshift:<region>:<your-account-id>:cluster:<cluster-identifier>"
          ]
        },
        {
          "Sid": "OwnStatementsOnly",
          "Effect": "Allow",
          "Action": [
            "redshift-data:DescribeStatement",
            "redshift-data:GetStatementResult",
            "redshift-data:CancelStatement"
          ],
          "Resource": "*",
          "Condition": {
            "StringEquals": {
              "redshift-data:statement-owner-iam-userid": "${aws:userid}"
            }
          }
        },
        {
          "Sid": "ServerlessSignIn",
          "Effect": "Allow",
          "Action": "redshift-serverless:GetCredentials",
          "Resource": "arn:aws:redshift-serverless:<region>:<your-account-id>:workgroup/<workgroup-id>"
        },
        {
          "Sid": "ClusterSignIn",
          "Effect": "Allow",
          "Action": "redshift:GetClusterCredentials",
          "Resource": [
            "arn:aws:redshift:<region>:<your-account-id>:dbuser:<cluster-identifier>/<database-user>",
            "arn:aws:redshift:<region>:<your-account-id>:dbname:<cluster-identifier>/<database>"
          ]
        }
      ]
    }
    

    OwnStatementsOnly lets the role read, fetch and cancel only the statements started by this role under the same session name (the condition compares aws:userid, which includes it). Scope GetClusterCredentials to exactly one database user, never dbuser:<cluster-identifier>/*.

    Save the two policies as trust.json and permissions.json, then create the role and attach the permissions:

    aws iam create-role --role-name <role-name> --path /controlvar-warehouse/ --assume-role-policy-document file://trust.json
    aws iam put-role-policy --role-name <role-name> --policy-name controlvar-warehouse --policy-document file://permissions.json
    
  4. Give the database user read access, as a Redshift administrator. Use a database user made for this connection, with SELECT on the source tables only, never a superuser or the admin user.

    • Serverless: the role signs in as the database user IAMR: followed by the role's name, for example IAMR:controlvar-reader for a role named controlvar-reader. Create it with no password, and do not give it the sys:superuser role:

      CREATE USER "IAMR:<role-name>" PASSWORD DISABLE;
      GRANT USAGE ON SCHEMA <schema> TO "IAMR:<role-name>";
      GRANT SELECT ON <schema>.<table> TO "IAMR:<role-name>";
      
    • Provisioned: the database user is the one you named in the connection:

      CREATE USER <database-user> PASSWORD DISABLE;
      GRANT USAGE ON SCHEMA <schema> TO <database-user>;
      GRANT SELECT ON <schema>.<table> TO <database-user>;
      
  5. Test the saved connection once the role and the grants exist. The test assumes the role and runs one statement that reads no table. Then name tables as schema.table in a source: the table is in the connection's own database.

Every statement runs as one transaction with the session time zone set to UTC, and Redshift is told to stop it a little after the connection's query_timeout_seconds. A Redshift connection is limited in time, not in bytes.

Each time Controlvar assumes your role for a test or a run, it first asks AWS to assume it without the external ID, and AWS must refuse that call. Expect a refused AssumeRole call in your CloudTrail beside each one that succeeds with the external ID: it is the check working, not a fault. Statements run in the role session named controlvar-warehouse.

Who can do what

Action ADMIN DEVELOPER ANALYST VIEWER
See which warehouses are available yes yes yes yes
List connections (never their credentials) yes yes yes no
Create, change, test or delete a connection yes no no no
Create, edit, validate, preview or delete an assignment source yes yes no no
Create, edit, validate or preview a metric source yes yes yes no
Delete a metric source yes yes no no
Start an analysis yes yes no no
Read analyses and their results yes yes yes no
Read the SQL an analysis or preview sent yes yes yes no

A superuser counts as ADMIN. A preview is stored as a run, so reading an analysis or a preview by its id (GET /runs/{run_id}) and listing an experiment's analyses both need ADMIN, DEVELOPER or ANALYST; a VIEWER gets 403 role_required from both (D50). Everyone who can read a run also gets its statements.

A refusal names the role needed and yours, for example Creating a warehouse connection requires the ADMIN role; you are DEVELOPER. Every change to a connection or a source, and every analysis started, is recorded in the compliance audit trail; a source's entry carries its full definition, and a connection's entry never carries its credentials.

Limits and cost

Every connection has limits, and each connection in the API shows its worst case per day (worst_case_bytes_per_day or worst_case_seconds_per_day):

  • Per query: a byte limit where the warehouse bills by bytes read, and a time limit (query_timeout_seconds, default 300) everywhere.
  • Per run: a run is one diagnostics statement plus one statement per metric, at most 10 metrics. A run can cost at most (1 + metrics) × the per-query limit.
  • Per day: max_runs_per_day (default 20) analyses and previews on the connection per UTC day, whatever their outcome. The count resets at 00:00 UTC. The worst case for a day is max_runs_per_day × 11 × the per-query limit.
  • At once: one analysis or preview per connection, and at most WAREHOUSE_MAX_CONCURRENT_RUNS (default 2) across the deployment.

Connection tests and source validation are not counted by the daily limit. They are ADMIN-only (validation: the source's editors) and each has a 30-second limit.

When a limit is reached the API answers:

Status code When
429 daily_run_limit_reached The connection has used max_runs_per_day today. Retry-After is the seconds until 00:00 UTC, and the body carries limit and resets_at.
429 warehouse_busy This deployment is already running as many warehouse jobs as it allows. Retry-After: 30. A refusal for capacity does not use a slot of the daily limit.
409 run_in_progress An analysis or preview on this connection has not finished.

For operators

Setting Default Meaning
WAREHOUSE_CREDENTIALS_KEYS unset Fernet keys, comma-separated, newest first, that encrypt stored warehouse credentials. While unset or empty, storing or using a credential answers 503 credentials_unavailable. In staging and production a malformed value is refused when the API starts, and the full profile's modules do not load until it is fixed.
WAREHOUSE_MAX_QUERY_TIMEOUT_SECONDS 1800 The highest query_timeout_seconds a connection may set.
WAREHOUSE_MAX_BYTES_PER_QUERY 214748364800 (200 GiB) The highest byte limit a connection may set.
WAREHOUSE_MAX_RUNS_PER_DAY 200 The highest max_runs_per_day a connection may set.
WAREHOUSE_MAX_CONCURRENT_JOBS 4 Threads per API process for warehouse calls. A call that finds none free is refused at once with 429 warehouse_busy; it never waits.
WAREHOUSE_MAX_CONCURRENT_RUNS 2 Analyses and previews in flight across the deployment.

A stored credential that none of the configured keys can open answers 409 credentials_undecryptable and the connection shows needs_new_credentials; an admin replaces it. Deleting a connection deletes its row and its credentials; its sources go with it, and its past analyses keep their results and the connection's name.

Both compose files pass WAREHOUSE_CREDENTIALS_KEYS to the API, empty by default, and an empty value is the same as one that is not set. Put it in the .env file next to the compose file: a value exported in another terminal does not reach the container, and one exported in the terminal that runs docker compose up does.

API

All routes are under /api/v1/warehouse/analysis, need a signed-in user, and take credentials only in a request body.

Method and path What it does
GET /connectors The warehouses this code knows and whether each is available here
GET, POST /connections List connections; create one
GET, PUT, DELETE /connections/{connection_id} Read, change or delete a connection
POST /connections/{connection_id}/test Sign in and run a statement that reads no table
POST /connections/test Test a connection's settings before saving them (nothing is stored)
POST /connections/{connection_id}/regenerate-key Generate a new key pair, for warehouses whose key the platform generates
GET, POST /sources List sources; create one
GET, PUT, DELETE /sources/{source_id} Read, change or delete a source
POST /sources/{source_id}/validate Check the table and columns against the warehouse's metadata
POST /sources/{source_id}/preview Counts and time bounds for the last 7 days, or a window you give
POST /experiments/{experiment_id}/runs Start an analysis (answers 202 with the run id)
GET /experiments/{experiment_id}/runs The experiment's analyses, newest first
GET /runs/{run_id} One analysis or preview: its status, results and, for ANALYST and above, the SQL sent

A source names a table or view and maps its columns:

{
  "kind": "metric",
  "connection_id": "3f6c1a52-0d7e-4a55-9a51-2b1f3f0b6e10",
  "name": "Purchases",
  "table": "ANALYTICS.PUBLIC.PURCHASES",
  "columns": {"unit_id": "user_id", "event_at": "purchased_at"},
  "metric_type": "proportion",
  "conversion_window_hours": 168,
  "filters": [{"column": "status", "operator": "eq", "value": "paid"}]
}

Each part of the table name and each column must match the warehouse's identifier rules, and a filter's text value may contain only letters, digits, spaces and _ . : @ / + -; anything else is refused with 422, never escaped. A source must be validated before a preview or an analysis uses it, and editing it clears its validation.

For a metric where a fall is better, add "lower_is_better": true. A PUT without lower_is_better sets it back to false, so send it on every PUT of a source marked lower is better. An assignment source has no direction: its lower_is_better is null, and a body that sends one is refused with 422.

A source body refuses any field it does not know with 422 (extra_forbidden). So during a deploy from a release without lower_is_better, while it serves both releases at once (the canary on AWS or a Helm rolling update), a request that sends lower_is_better and reaches an API task or pod still on that release is refused; retry once the deploy has finished. A dashboard opened before that deploy does not send lower_is_better, so saving a metric source from it can set the setting back to false: reload the dashboard after it.

An analysis names the sources, and optionally the window and which warehouse variant label is which experiment variant (labels not listed are matched to a variant by its name):

{
  "connection_id": "3f6c1a52-0d7e-4a55-9a51-2b1f3f0b6e10",
  "assignment_source_id": "8a0d5c1e-7b1f-4a8e-9f0e-6a0b2c3d4e5f",
  "metric_source_ids": ["b2c7e9f1-3a4d-4c5b-8e6f-7a8b9c0d1e2f"],
  "window_start": "2026-09-01T00:00:00Z",
  "variant_map": {"ctl": "0f1e2d3c-4b5a-4968-8776-655443322110"}
}

The window defaults to the experiment's start date up to its end date or now; a time without an offset is read as UTC. The run moves from queued to running to succeeded or failed. A failed run carries an error_code from a fixed set and reports no numbers; a metric that could not be computed says Not computed: and why, never 0. A mean metric needs at least 2 units in every variant (Not computed: fewer than 2 units otherwise). When the values vary in neither the control nor a treatment, that treatment has no p-value and its note says Not computed: no variation.

Errors are {"detail": {"code": ..., "message": ...}}. A request that fails validation lists where and why, but never repeats the value you sent.

Troubleshooting

The codes below are the whole set. A failed call answers with one as code, and a failed run reports one as its error_code. A metric that could not be computed can carry fewer_than_2_units, no_units or join_key_mismatch as its "Not computed" reason while the run itself succeeds. Status is the HTTP status of a route that answers with the code directly.

Code Status What it means What to check
credentials_unavailable 503 WAREHOUSE_CREDENTIALS_KEYS is not set, so no stored credential can be used. An operator sets it: see For operators.
aws_identity_unavailable 503 This deployment has no AWS identity to assume a connection's AWS role from. Not raised for Snowflake or BigQuery, which use no AWS role. An operator runs the API with an AWS identity that may call sts:AssumeRole on the connection's role.
auth_failed 502 The warehouse did not accept the connection's credentials. Snowflake: the public key registered on the user is the one Controlvar shows, and the account identifier is right. BigQuery: the service account and its JSON key still exist. Redshift: the role's trust policy names the identity the API runs as and requires the external ID shown on the connection. Then test the connection.
key_revoked 502 BigQuery reports that the key's service account client was disabled or deleted. Enable the service account or create a new JSON key, and paste it into the connection. Snowflake does not report this.
permission_denied 502 The role may not run this query. Snowflake: USAGE on the warehouse, database and schema, and SELECT on the table. BigQuery: BigQuery Job User on the billing project, and BigQuery Data Viewer on each dataset. Redshift: the role's policy names this connection's own workgroup or cluster as the resource of BatchExecuteStatement and DescribeTable; with a policy scoped that way, a connection that names a cluster the policy does not list answers permission_denied with the vendor code AccessDeniedException.
object_not_found 502 A table, view or column the query names was not found. The table is named in full, with each part as the warehouse stores it, and every mapped column exists. On Snowflake a table the role may not see is reported the same way. On Redshift the table is schema.table in the connection's database; a table the database user may not read is not reported this way (see unrecognised_warehouse_error).
not_a_select 502 The statement was not a single SELECT, so it was not run. Controlvar writes the SQL itself, so this is unexpected: report it.
bytes_limit 502 The query would read more than the connection's bytes cap, by Controlvar's dry-run check or BigQuery's own limit, so it was not run. Raise "Most data a query may read" (up to WAREHOUSE_MAX_BYTES_PER_QUERY), or point the source at a smaller or partitioned table. Snowflake has no byte limit.
time_limit 504 The warehouse did not finish within query_timeout_seconds. Raise it (up to WAREHOUSE_MAX_QUERY_TIMEOUT_SECONDS), or give the source a smaller table or a shorter window.
cancelled 502 The warehouse cancelled the query. Whether someone, or a resource monitor, cancelled it: see the warehouse's own query history.
workgroup_unsafe 502 Not raised for Snowflake, BigQuery or Amazon Redshift. Nothing.
role_trust_unsafe 502 The trust policy of a connection's AWS role admits this deployment without the connection's external ID, so the role is refused. Not raised for Snowflake or BigQuery, which use no AWS role. The role's trust policy has a condition that requires sts:ExternalId to equal the external ID shown on the connection's page.
timezone_not_utc 502 Snowflake or Redshift reported a session time zone other than UTC, after Controlvar set it. The run is refused because times would be compared in another zone. Start the analysis again; if it recurs, report it. BigQuery does not report this.
result_invalid 502 The warehouse returned a result in a shape Controlvar does not accept, or one that was too large. Start the analysis again; if it recurs, check that the source maps the columns you mean, and report it.
too_many_variant_values 502 The variant column has more distinct values than allowed. The assignment source's variant column holds a variant label, not an id that differs per unit.
join_key_mismatch 502 The metric source has rows in the window, but none has the unit id of an exposed unit. Both sources map the same identifier, with the same type and form.
no_units 502 No exposed units were found in the window. The experiment key in the assignment source, the window, and the source's filters.
fewer_than_2_units 502 A variant has fewer than 2 units, so a mean cannot be compared. Wait for more exposures, or widen the window.
abandoned 502 The run stopped reporting progress and was marked as failed. Start the analysis again. The run still counts toward the daily limit.
warehouse_busy 429 This deployment is already running as many warehouse jobs as it allows. For Redshift, Controlvar also answers it for the Data API's ActiveStatementsExceededException, ActiveSessionsExceededException, ActiveWaitingRequestsExceededException and ThrottlingException, and for STS Throttling when it assumes your role; those are how the code maps them, and none of them was provoked in the live check. Try again after the Retry-After seconds; see Limits and cost.
run_in_progress 409 An analysis or preview on this connection has not finished. Wait for it to finish, then start yours.
destination_not_allowed 502 The warehouse address is not one this deployment connects to. Snowflake: the account is the organisation-account identifier, not a locator or a URL. An address that resolves to a private network is refused. Redshift: redshift-data.<region>.amazonaws.com and sts.<region>.amazonaws.com must resolve to public addresses. An interface VPC endpoint with private DNS resolves them to private ones, so we expect it to be refused; we have not run one.
redirect_refused 502 The warehouse answered with a redirect, which Controlvar does not follow. The account identifier or the location in the connection.
unreachable 502 The warehouse could not be reached. That the API can open an outbound HTTPS connection to the warehouse, and that its firewall or network policy allows the API's address. Redshift: Data API not offered in that region; the endpoint is redshift-data.<region>.amazonaws.com, so pick a region where AWS offers the Data API.
unrecognised_warehouse_error 502 The warehouse sent an error code that Controlvar has no entry for. The vendor code, as described below.
internal 500 Something went wrong on Controlvar's side while talking to the warehouse. An operator reads the API's log, where a warehouse failure is logged with its code.

For unrecognised_warehouse_error, the message and the body's vendor_code give the warehouse's own code: for BigQuery the reason of the error, for Snowflake its error code. Look that code up in the warehouse's documentation, and find the statement in its query or job history. Controlvar never repeats the warehouse's own error text.

For Redshift the vendor_code is the Data API's own code. With the policy above, a workgroup that does not exist in the region answers ValidationException. FAILED means Redshift ran the batch and a statement in it failed; a table the database user may not read is one such case. For FAILED, take the log field request_id to aws redshift-data describe-statement --id <request_id>, signed as the connection's role with the role session name controlvar-warehouse: assume the role from the API's identity with the connection's external ID and --role-session-name controlvar-warehouse. The statement-owner condition keys on aws:userid, which includes the session name. The answer's Status is FAILED, and its Error is Redshift's own text, which Controlvar never reads. The request_id is the Data API id of the first sub-statement that failed (<statement id>:<n>); it is logged and never returned. We have not measured whether a principal other than the connector's own live session can describe it, or for how long after the run it can be described, so treat both as suggestions.

If you ran an earlier full-profile release

As of v0.9.0, the earlier /api/v1/warehouse endpoints (saved connections, sync, and the ClickHouse, MySQL and Databricks connectors) are removed, and the migration to the warehouse analysis tables deletes the connections they saved (see Upgrading and migrations). Rotate every credential that was ever saved there, and every credential sent to those endpoints in a query parameter: it may be in your access logs.

See Modules and profiles for what each profile includes.