Metrics
Fix empty or refused underlying data
When View underlying data is empty or says the data source denied access, upgrade an old plugin or give the Databrain user read access to the table.
Your warehouse decides what Databrain can read. When it refuses a table, the Underlying data dialog gets no rows.
What the message means
Databrain signs in to your warehouse as one user: the datasource user. The warehouse let that user sign in, but it refused to let it read a table that the rows come from. Databrain did not get any rows, so it has none to show.
| Who | What they see |
|---|---|
| You, in Databrain | No access to a table: The data source denied access to a table this query reads. Ask your admin to grant SELECT on this table to the Databrain user. |
| A viewer in an embed | This chart has a data setup problem. Contact your admin. |
On Snowflake, the warehouse gives the same answer for a missing table and for no access. You see A table or column this query reads was not found. Do the steps below for both.
Every card says No Data Available in an embed
Some older plugin versions, for example 0.16.70, do not send the guest token when a viewer opens underlying data. Databrain answers that request with HTTP 401, before it reaches your warehouse. The dialog then shows No Data Available on every card, also when the warehouse grants are right.
Upgrade @databrainhq/plugin to 0.17.0 or later. To see the version your app uses, run npm ls @databrainhq/plugin. A change in Databrain or in the warehouse does not fix this.
Before you start
- You know the datasource user. Go to Data Studio > Datasources, open the datasource and look at the username, role or service account on the Connection tab.
- You know the table. It is a table the metric reads. Open the metric to see its tables.
- Your database admin can change grants in the warehouse. Databrain cannot change them for you.
Ask for read access
Send your database admin the grant for your warehouse. Replace the names in <>.
Trino
Trino checks access in its access control, so the grant depends on how your cluster is set up.
If the catalog accepts SQL grants:
GRANT SELECT ON <catalog>.<schema>.<table> TO USER <databrain_user>;If the cluster uses file-based access control, add a table rule for the user:
{
"tables": [
{
"user": "<databrain_user>",
"catalog": "<catalog>",
"schema": "<schema>",
"table": "<table>",
"privileges": ["SELECT"]
}
]
}If the cluster uses Apache Ranger or another policy tool, ask for a SELECT policy on the table for the user.
PostgreSQL
GRANT USAGE ON SCHEMA <schema> TO <databrain_user>;
GRANT SELECT ON <schema>.<table> TO <databrain_user>;To cover every table that is in the schema now:
GRANT SELECT ON ALL TABLES IN SCHEMA <schema> TO <databrain_user>;Amazon Redshift
GRANT USAGE ON SCHEMA <schema> TO <databrain_user>;
GRANT SELECT ON <schema>.<table> TO <databrain_user>;For every table in the schema: GRANT SELECT ON ALL TABLES IN SCHEMA <schema> TO <databrain_user>;
Snowflake
Snowflake gives access to a role. Grant it to the role that the datasource uses:
GRANT USAGE ON DATABASE <db> TO ROLE <databrain_role>;
GRANT USAGE ON SCHEMA <db>.<schema> TO ROLE <databrain_role>;
GRANT SELECT ON TABLE <db>.<schema>.<table> TO ROLE <databrain_role>;For a view, use GRANT SELECT ON VIEW. For tables made later: GRANT SELECT ON FUTURE TABLES IN SCHEMA <db>.<schema> TO ROLE <databrain_role>;
BigQuery
BigQuery uses IAM roles. The service account needs:
roles/bigquery.dataVieweron the dataset or the table.roles/bigquery.jobUseron the project that runs the queries.
To grant the dataset role in SQL:
GRANT `roles/bigquery.dataViewer`
ON SCHEMA `<project>.<dataset>`
TO "serviceAccount:<service_account_email>";Other warehouses
Grant SELECT on the table to the datasource user. The warehouse codes for each connector are on Permission denied.
Check again
-
In the warehouse, sign in as the datasource user, with the same role or service account as the datasource, and run this. Write the table’s full name, with its catalog, database or project, and quote it the way your warehouse needs:
SELECT * FROM <qualified_table_name> LIMIT 1;On SQL Server and Microsoft Fabric, use
SELECT TOP (1) * FROM <qualified_table_name>;instead.If this fails, send the exact error to your database admin. They check that the table exists, its location where the warehouse has one, and the grants of that user or role.
-
In Databrain, go to Data Studio > Datasources and select Sync schema on the datasource.
-
Open the dashboard. On the card, select More actions and then View as table.
You see the rows. If the dialog is still empty and shows no message, check each table the metric reads in step 1, then the dashboard filters, the client you view as, and whether the embed allows underlying data.
Related: Download underlying data.