Skip to content

DataHub

Datasets, columns, owners, glossary, lineage, assertions and usage from DataHub as SQL

Connector software
Free and open source
Service credentials
Required
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/datahub/index.md to help me query DataHub with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Count Snowflake datasets by schema

Uses your connected account. Set up the connector and credentials to run it with your data.

SELECT schema, count(*) AS tables
FROM datahub.main.datasets
WHERE platform = 'snowflake'
GROUP BY schema
ORDER BY tables DESC

Quick start

Choose where to run DataHub, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'datahub' AS datahub (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-datahub-worker'
);

3. Add service credentials

After attaching, create the secret for the service you want to query in the same SQL session. Replace the placeholders with your service settings.

datahub credentials

Connection to a DataHub (open-source or DataHub Cloud) metadata service: GMS_URL and/or FRONTEND_URL plus a personal access TOKEN.

Get these credentials β†’
secret.sql
CREATE SECRET datahub (
    TYPE datahub,
    gms_url      '<gms_url>',
    frontend_url '<frontend_url>',
    token        '<DATAHUB_TOKEN>',  -- secret
    page_size    '<page_size>'
);
Credential fields and requirements β†’

4. Run a query

query.sql
SELECT schema, count(*) AS tables
FROM datahub.main.datasets
WHERE platform = 'snowflake'
GROUP BY schema
ORDER BY tables DESC
More example queries β†’
Technical details
Verified connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'datahub' AS datahub (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-datahub-worker'
);

Overview

DataHub (open-source and DataHub Cloud) metadata catalog as SQL: datasets, columns, owners, tags, glossary, domains, lineage, assertions, profiles and usage, read through the DataHub GraphQL API.

Catalog

Everything datahub exposes once attached β€” read straight from the worker's released build.

datahub 1 schema
main 22 tables Β· 5 functions

DataHub datasets, columns, governance metadata, lineage, assertions, profiles and usage.

Schema examples (33)
Examples (33)

Snowflake datasets per schema (platform pushes down)

SELECT schema, count(*) AS tables
FROM datahub.main.datasets
WHERE platform = 'snowflake'
GROUP BY schema
ORDER BY tables DESC;

Datasets nobody owns

SELECT qualified_name, domain
FROM datahub.main.datasets
WHERE len(owners) = 0 AND NOT deprecated
ORDER BY qualified_name;

Columns tagged PII

SELECT qualified_name, column_name
FROM datahub.main.columns
WHERE list_contains(tags, 'pii')
ORDER BY qualified_name, column_name;

One dataset's schema (dataset_id pushes down)

SELECT column_name, native_data_type, nullable
FROM datahub.main.columns
WHERE dataset_id = 'urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.marts.fct_orders,PROD)'
ORDER BY ordinal_position;
29 more examples

Datasets per schema container

SELECT c.qualified_name, count(d.id) AS datasets
FROM datahub.main.containers c
LEFT JOIN datahub.main.datasets d ON d.container_id = c.id
WHERE c.subtype = 'Schema'
GROUP BY ALL
ORDER BY datasets DESC;

Dashboards per BI tool and how many lack an owner

SELECT platform, count(*) AS dashboards,
  count(*) FILTER (WHERE len(owners) = 0) AS unowned
FROM datahub.main.dashboards
GROUP BY platform
ORDER BY dashboards DESC;

The datasets each chart reads

SELECT c.name, e.upstream_qualified_name
FROM datahub.main.charts c
JOIN datahub.main.lineage_edges e ON e.downstream_id = c.id
WHERE e.level = 'dataset'
ORDER BY c.name;

Tasks per pipeline

SELECT f.name, count(j.id) AS tasks
FROM datahub.main.data_flows f
LEFT JOIN datahub.main.data_jobs j ON j.flow_id = f.id
GROUP BY f.name
ORDER BY tasks DESC;

Which datasets each Airflow task writes

SELECT name, unnest(output_dataset_ids) AS writes
FROM datahub.main.data_jobs
WHERE platform = 'airflow'
ORDER BY name;

Datasets owned per person or group

SELECT owner_name, count(*) AS datasets
FROM datahub.main.owners
WHERE entity_type = 'dataset'
GROUP BY owner_name
ORDER BY datasets DESC;

How many columns carry each tag

SELECT t.name, count(c.column_name) AS tagged_columns
FROM datahub.main.tags t
LEFT JOIN datahub.main.columns c ON list_contains(c.tags, t.name)
GROUP BY t.name
ORDER BY tagged_columns DESC;

Terms per top-level glossary node

SELECT parent_path[1] AS top_node, count(*) AS terms
FROM datahub.main.glossary_terms
GROUP BY top_node
ORDER BY terms DESC;

Terms directly under each glossary node

SELECT n.name, count(t.id) AS terms
FROM datahub.main.glossary_nodes n
LEFT JOIN datahub.main.glossary_terms t ON t.parent_node_id = n.id
GROUP BY n.name
ORDER BY n.name;

Domains by asset count

SELECT name, asset_count
FROM datahub.main.domains
ORDER BY asset_count DESC;

Data products and assets per domain

SELECT domain, count(*) AS products, sum(asset_count) AS assets
FROM datahub.main.data_products
GROUP BY domain
ORDER BY products DESC;

Assets owned per user

SELECT u.display_name, count(o.entity_id) AS owned
FROM datahub.main.users u
LEFT JOIN datahub.main.owners o ON o.owner_id = u.id
GROUP BY u.display_name
ORDER BY owned DESC;

Assets owned per team

SELECT g.name, count(o.entity_id) AS owned
FROM datahub.main.groups g
LEFT JOIN datahub.main.owners o ON o.owner_id = g.id
GROUP BY g.name
ORDER BY owned DESC;

Where each column of one table comes from (downstream_id pushes down)

SELECT upstream_qualified_name, upstream_column, downstream_column
FROM datahub.main.lineage_edges
WHERE level = 'column' AND downstream_id = 'urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.marts.fct_orders,PROD)'
ORDER BY downstream_column;

Lineage edges by downstream entity type

SELECT downstream_type, count(*) AS edges
FROM datahub.main.lineage_edges
WHERE level = 'dataset'
GROUP BY downstream_type
ORDER BY edges DESC;

Assertions whose latest run failed

SELECT qualified_name, assertion_type, description, last_run_at
FROM datahub.main.assertions
WHERE last_status = 'failed'
ORDER BY last_run_at DESC;

Failure counts per dataset since a date (run_at pushes down)

SELECT qualified_name,
  count(*) FILTER (WHERE status = 'failed') AS failures, count(*) AS runs
FROM datahub.main.assertion_results
WHERE run_at >= TIMESTAMPTZ '2026-01-01 00:00:00+00'
GROUP BY qualified_name
ORDER BY failures DESC;

Latest row count per dataset

SELECT qualified_name, max_by(row_count, profiled_at) AS latest_rows
FROM datahub.main.dataset_profiles
GROUP BY qualified_name
ORDER BY latest_rows DESC;

Last write per dataset (stalest first)

SELECT qualified_name, max(operation_at) AS last_write
FROM datahub.main.operations
GROUP BY qualified_name
ORDER BY last_write;

The ten most-queried datasets this month

SELECT qualified_name, query_count, unique_user_count
FROM datahub.main.usage
WHERE time_range = 'MONTH'
ORDER BY query_count DESC
LIMIT 10;

Open incidents, newest first (state pushes down)

SELECT qualified_name, title, priority, created_at
FROM datahub.main.incidents
WHERE state = 'ACTIVE'
ORDER BY created_at DESC;

Datasets and dashboards about orders

SELECT entity_type, name, qualified_name
FROM datahub.main.search('orders')
WHERE entity_type IN ('dataset', 'dashboard')
ORDER BY entity_type, name;

Snowflake datasets tagged PII (tag, type and platform all push down)

SELECT qualified_name
FROM datahub.main.search('*', tag := 'pii')
WHERE entity_type = 'dataset' AND platform = 'snowflake'
ORDER BY qualified_name;

Every dataset a table depends on, nearest first

SELECT qualified_name, degree
FROM datahub.main.lineage('urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.marts.fct_orders,PROD)')
WHERE entity_type = 'dataset'
ORDER BY degree, qualified_name;

Charts and dashboards affected by a change to a raw table

SELECT entity_type, name
FROM datahub.main.lineage('urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.raw.orders,PROD)', direction := 'downstream', max_hops := 5)
WHERE entity_type IN ('chart', 'dashboard')
ORDER BY name;

Most-consumed upstream datasets by qualified name

SELECT datahub.main.dataset_qualified_name(upstream_id) AS source,
  count(*) AS consumers
FROM datahub.main.lineage_edges
WHERE level = 'dataset' AND upstream_type = 'dataset'
GROUP BY ALL
ORDER BY consumers DESC;

Lineage edges per upstream platform

SELECT datahub.main.parse_dataset_urn(upstream_id).platform AS platform,
  count(*) AS edges
FROM datahub.main.lineage_edges
WHERE upstream_type = 'dataset'
GROUP BY ALL
ORDER BY edges DESC;

A table's columns, looked up by platform and name

SELECT column_name, native_data_type
FROM datahub.main.columns
WHERE dataset_id = datahub.main.dataset_urn('snowflake', 'analytics.marts.fct_orders')
ORDER BY ordinal_position;

Look up a DEV table by platform and name

SELECT qualified_name, environment
FROM datahub.main.datasets
WHERE id = datahub.main.dataset_urn('bigquery', 'proj.ds.events', 'dev');
Tables
assertion_results 1 example16 cols

Assertion run history: one row per evaluation with pass/fail and observed values

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
assertion_idnot null VARCHAR
Assertion URN (assertions.id).
dataset_idnot null VARCHAR
URN of the dataset (datasets.id).
platform VARCHAR
Data platform of the dataset.
qualified_name VARCHAR
Lower-cased database.schema.table of the dataset.
assertion_type VARCHAR
What kind of check ran: FRESHNESS, VOLUME, FIELD, SQL, DATASET, ...
run_id VARCHAR
Run id of the evaluation.
run_atnot null TIMESTAMP WITH TIME ZONE
When the assertion was evaluated.
status VARCHAR
'passed', 'failed', 'error' or 'init'.
result_type VARCHAR
DataHub result type: SUCCESS, FAILURE, ERROR or INIT.
row_count BIGINT
Number of rows the evaluation looked at (count of rows).
unexpected_count BIGINT
Number of rows that violated the assertion (count of rows).
missing_count BIGINT
Number of rows with a missing value (count of rows).
actual_value DOUBLE
Observed aggregate value (e.g. the row count of a volume check).
external_url VARCHAR
Link to the run in the evaluating tool.
native_results MAP(VARCHAR, VARCHAR)
Tool-specific result details.
Example

Failure counts per dataset since a date (run_at pushes down)

SELECT qualified_name,
  count(*) FILTER (WHERE status = 'failed') AS failures, count(*) AS runs
FROM datahub.main.assertion_results
WHERE run_at >= TIMESTAMPTZ '2026-01-01 00:00:00+00'
GROUP BY qualified_name
ORDER BY failures DESC;
Link
assertions 1 example16 cols

Data quality assertions on each dataset with their latest pass/fail status

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Assertion URN.
dataset_idnot null VARCHAR
URN of the dataset (datasets.id).
platform VARCHAR
Data platform of the dataset.
qualified_name VARCHAR
Lower-cased database.schema.table of the dataset.
assertion_type VARCHAR
FRESHNESS, VOLUME, FIELD, SQL, DATASET, DATA_SCHEMA or CUSTOM.
description VARCHAR
Description of what the assertion checks.
source_type VARCHAR
NATIVE (DataHub-run), EXTERNAL (dbt, Great Expectations, ...) or INFERRED.
assertion_platform VARCHAR
Platform that evaluates it, e.g. 'dbt', 'great-expectations'.
column_names VARCHAR[]
Columns the assertion is about (field / column assertions).
operator VARCHAR
Comparison operator, e.g. GREATER_THAN, NOT_NULL, BETWEEN, _NATIVE_.
native_type VARCHAR
The evaluating tool's own assertion type (e.g. dbt test name).
last_status VARCHAR
Latest run: 'passed', 'failed', 'error', 'init' or NULL if never run.
last_run_at TIMESTAMP WITH TIME ZONE
When the latest run happened.
external_url VARCHAR
Link to the assertion in the evaluating tool.
url VARCHAR
Link to the dataset in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Assertions whose latest run failed

SELECT qualified_name, assertion_type, description, last_run_at
FROM datahub.main.assertions
WHERE last_status = 'failed'
ORDER BY last_run_at DESC;
Link
charts 1 example17 cols

BI charts / tiles / looks indexed by DataHub

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Chart URN.
platform VARCHAR
Tool / platform, e.g. 'looker', 'tableau', 'airflow'.
name VARCHAR
Display name.
description VARCHAR
Description (UI-edited one first).
chart_key VARCHAR
The tool's own chart id.
chart_type VARCHAR
BAR, LINE, TABLE, PIE, ... when the tool reports it.
owners VARCHAR[]
Owner URNs.
tags VARCHAR[]
Tag names.
glossary_terms VARCHAR[]
Glossary term names.
domain_id VARCHAR
Domain URN.
domain VARCHAR
Domain name.
container_id VARCHAR
Parent container URN (workspace / folder / project).
created_at TIMESTAMP WITH TIME ZONE
Creation time in the tool.
updated_at TIMESTAMP WITH TIME ZONE
Last modification in the tool.
external_url VARCHAR
Link to the chart in the BI tool.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

The datasets each chart reads

SELECT c.name, e.upstream_qualified_name
FROM datahub.main.charts c
JOIN datahub.main.lineage_edges e ON e.downstream_id = c.id
WHERE e.level = 'dataset'
ORDER BY c.name;
Link
columns 2 examples14 cols

Every column of every DataHub dataset with types, nullability, descriptions, tags and terms

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
dataset_idnot null VARCHAR
URN of the dataset (datasets.id).
platform VARCHAR
Data platform of the dataset.
qualified_name VARCHAR
Lower-cased database.schema.table of the dataset.
column_namenot null VARCHAR
Column name; nested fields as dotted paths ('address.city').
field_pathnot null VARCHAR
DataHub's raw fieldPath (v2 paths keep their [type=...] tokens).
ordinal_positionnot null INTEGER
1-based position in the dataset's schema.
data_type VARCHAR
DataHub type: STRING, NUMBER, BOOLEAN, DATE, TIME, STRUCT, ARRAY, ...
native_data_type VARCHAR
The source platform's type, e.g. 'VARCHAR(16777216)'.
nullablenot null BOOLEAN
True if the column accepts NULL.
is_primary_keynot null BOOLEAN
True if the column is in the schema's primary key.
description VARCHAR
Column description (UI-edited one first, else the ingested one).
tags VARCHAR[]
Tag names on the column (ingested and UI-edited).
glossary_terms VARCHAR[]
Glossary term names on the column (ingested and UI-edited).
ConstraintsPRIMARY KEY (dataset_id, field_path)
Examples (2)

Columns tagged PII

SELECT qualified_name, column_name
FROM datahub.main.columns
WHERE list_contains(tags, 'pii')
ORDER BY qualified_name, column_name;

One dataset's schema (dataset_id pushes down)

SELECT column_name, native_data_type, nullable
FROM datahub.main.columns
WHERE dataset_id = 'urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.marts.fct_orders,PROD)'
ORDER BY ordinal_position;
Link
containers 1 example15 cols

DataHub containers: the database / schema / project / folder hierarchy datasets live in

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Container URN.
platform VARCHAR
Data platform.
namenot null VARCHAR
Container name.
subtype VARCHAR
First subtype: 'Database', 'Schema', 'Project', 'Dataset', 'Folder', ...
qualified_name VARCHAR
Lower-cased dotted path of the container (e.g. 'analytics.marts').
parent_container_id VARCHAR
URN of the parent container.
container_path VARCHAR[]
Container names from the root down to this one.
description VARCHAR
Container description (UI-edited one first).
owners VARCHAR[]
Owner URNs.
tags VARCHAR[]
Tag names.
domain_id VARCHAR
Domain URN.
domain VARCHAR
Domain name.
external_url VARCHAR
Link in the source platform.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Datasets per schema container

SELECT c.qualified_name, count(d.id) AS datasets
FROM datahub.main.containers c
LEFT JOIN datahub.main.datasets d ON d.container_id = c.id
WHERE c.subtype = 'Schema'
GROUP BY ALL
ORDER BY datasets DESC;
Link
dashboards 1 example18 cols

BI dashboards indexed by DataHub, with owners, tags, domain and view counts

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Dashboard URN.
platform VARCHAR
Tool / platform, e.g. 'looker', 'tableau', 'airflow'.
name VARCHAR
Display name.
description VARCHAR
Description (UI-edited one first).
dashboard_key VARCHAR
The tool's own dashboard id.
owners VARCHAR[]
Owner URNs.
tags VARCHAR[]
Tag names.
glossary_terms VARCHAR[]
Glossary term names.
domain_id VARCHAR
Domain URN.
domain VARCHAR
Domain name.
container_id VARCHAR
Parent container URN (workspace / folder / project).
created_at TIMESTAMP WITH TIME ZONE
Creation time in the tool.
updated_at TIMESTAMP WITH TIME ZONE
Last modification in the tool.
last_refreshed_at TIMESTAMP WITH TIME ZONE
Last data refresh reported by the tool.
view_count BIGINT
View count from DataHub's dashboard stats summary.
external_url VARCHAR
Link to the dashboard in the BI tool.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Dashboards per BI tool and how many lack an owner

SELECT platform, count(*) AS dashboards,
  count(*) FILTER (WHERE len(owners) = 0) AS unowned
FROM datahub.main.dashboards
GROUP BY platform
ORDER BY dashboards DESC;
Link
data_flows 1 example16 cols

Pipelines (DataHub data flows): Airflow DAGs, dbt projects, Spark apps, Fivetran connectors

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Data flow (pipeline) URN.
platform VARCHAR
Tool / platform, e.g. 'looker', 'tableau', 'airflow'.
name VARCHAR
Display name.
description VARCHAR
Description (UI-edited one first).
flow_key VARCHAR
The orchestrator's pipeline id (DAG id, job name, ...).
cluster VARCHAR
Cluster / environment the flow runs in.
project VARCHAR
Project the flow belongs to, when reported.
owners VARCHAR[]
Owner URNs.
tags VARCHAR[]
Tag names.
glossary_terms VARCHAR[]
Glossary term names.
domain_id VARCHAR
Domain URN.
domain VARCHAR
Domain name.
container_id VARCHAR
Parent container URN (workspace / folder / project).
external_url VARCHAR
Link to the pipeline in the orchestrator.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Tasks per pipeline

SELECT f.name, count(j.id) AS tasks
FROM datahub.main.data_flows f
LEFT JOIN datahub.main.data_jobs j ON j.flow_id = f.id
GROUP BY f.name
ORDER BY tasks DESC;
Link
data_jobs 1 example17 cols

Pipeline tasks (DataHub data jobs) with their input and output datasets

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Data job (task) URN.
platform VARCHAR
Tool / platform, e.g. 'looker', 'tableau', 'airflow'.
name VARCHAR
Display name.
description VARCHAR
Description (UI-edited one first).
flow_id VARCHAR
URN of the pipeline this task belongs to (data_flows.id).
job_key VARCHAR
The orchestrator's task id.
input_dataset_ids VARCHAR[]
URNs of the datasets the task reads.
output_dataset_ids VARCHAR[]
URNs of the datasets the task writes.
owners VARCHAR[]
Owner URNs.
tags VARCHAR[]
Tag names.
glossary_terms VARCHAR[]
Glossary term names.
domain_id VARCHAR
Domain URN.
domain VARCHAR
Domain name.
container_id VARCHAR
Parent container URN (workspace / folder / project).
external_url VARCHAR
Link to the task in the orchestrator.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Which datasets each Airflow task writes

SELECT name, unnest(output_dataset_ids) AS writes
FROM datahub.main.data_jobs
WHERE platform = 'airflow'
ORDER BY name;
Link
data_products 1 example12 cols

Data products: curated groups of assets owned by a domain

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Data product URN.
namenot null VARCHAR
Data product name.
description VARCHAR
What the data product offers its consumers.
domain_id VARCHAR
Domain URN.
domain VARCHAR
Domain name.
asset_count BIGINT
Number of assets in the data product.
owners VARCHAR[]
Owner URNs.
tags VARCHAR[]
Tag names.
glossary_terms VARCHAR[]
Glossary term names.
external_url VARCHAR
External link.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Data products and assets per domain

SELECT domain, count(*) AS products, sum(asset_count) AS assets
FROM datahub.main.data_products
GROUP BY domain
ORDER BY products DESC;
Link
dataset_profiles 1 example9 cols

Dataset profiles over time: row counts, sizes and per-column statistics

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
dataset_idnot null VARCHAR
URN of the dataset (datasets.id).
platform VARCHAR
Data platform of the dataset.
qualified_name VARCHAR
Lower-cased database.schema.table of the dataset.
profiled_atnot null TIMESTAMP WITH TIME ZONE
When the profile was taken.
row_count BIGINT
Rows in the dataset.
column_count BIGINT
Columns in the dataset.
size_bytes BIGINT
Storage size in bytes.
column_profiles STRUCT of 10 fields[]
Per-column statistics: column_name, null_count, null_proportion, unique_count, unique_proportion, min, max, mean, median, stdev (values as text).
STRUCT[] 10 fields
  • column_nameVARCHAR
  • null_countBIGINT
  • null_proportionDOUBLE
  • unique_countBIGINT
  • unique_proportionDOUBLE
  • minVARCHAR
  • maxVARCHAR
  • meanVARCHAR
  • medianVARCHAR
  • stdevVARCHAR
ConstraintsPRIMARY KEY (dataset_id, profiled_at)
Example

Latest row count per dataset

SELECT qualified_name, max_by(row_count, profiled_at) AS latest_rows
FROM datahub.main.dataset_profiles
GROUP BY qualified_name
ORDER BY latest_rows DESC;
Link
datasets 2 examples25 cols

Every DataHub dataset with platform, qualified name, owners, tags, terms and domain

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Dataset URN, e.g. 'urn:li:dataset:(urn:li:dataPlatform:snowflake,db.sch.t,PROD)'.
platform VARCHAR
Data platform, e.g. 'snowflake', 'bigquery', 'kafka', 'dbt'.
platform_instance VARCHAR
Platform instance id, when the platform has several.
environment VARCHAR
Environment (DataHub FabricType): PROD, DEV, QA, ...
database VARCHAR
Database / project / catalog part of the name (relational platforms).
schema VARCHAR
Schema / dataset part of the name (relational platforms).
namenot null VARCHAR
Table name (relational platforms) or the full dataset name otherwise.
qualified_name VARCHAR
Lower-cased 'database.schema.table' (fewer parts when the platform has fewer); the join key to dbt / OpenLineage / Looker and the other catalog workers.
full_name VARCHAR
DataHub's dataset name as in the URN (without the platform instance).
subtype VARCHAR
First DataHub subtype: 'Table', 'View', 'Topic', 'Model', ...
description VARCHAR
Description (UI-edited one first, else the ingested one).
owners VARCHAR[]
Owner URNs (users and groups); see the owners table for types.
tags VARCHAR[]
Tag names on the dataset.
glossary_terms VARCHAR[]
Glossary term names on the dataset.
domain_id VARCHAR
Domain URN.
domain VARCHAR
Domain name.
container_id VARCHAR
URN of the immediate parent container (schema / database / folder).
deprecatednot null BOOLEAN
True if the dataset is marked deprecated.
custom_properties MAP(VARCHAR, VARCHAR)
Ingested custom properties.
created_at TIMESTAMP WITH TIME ZONE
Creation time reported by the source platform.
updated_at TIMESTAMP WITH TIME ZONE
Last modification reported by the source platform.
last_ingested_at TIMESTAMP WITH TIME ZONE
When DataHub last ingested metadata for the dataset.
external_url VARCHAR
Link to the dataset in its source platform.
url VARCHAR
Link to the dataset in the DataHub UI (needs FRONTEND_URL or a Cloud GMS_URL).
ConstraintsPRIMARY KEY (id)
Examples (2)

Snowflake datasets per schema (platform pushes down)

SELECT schema, count(*) AS tables
FROM datahub.main.datasets
WHERE platform = 'snowflake'
GROUP BY schema
ORDER BY tables DESC;

Datasets nobody owns

SELECT qualified_name, domain
FROM datahub.main.datasets
WHERE len(owners) = 0 AND NOT deprecated
ORDER BY qualified_name;
Link
domains 1 example8 cols

Domains (business areas) with their parent domain and asset counts

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Domain URN.
namenot null VARCHAR
Domain name.
description VARCHAR
What the domain covers.
parent_domain_id VARCHAR
URN of the parent domain (NULL for a top-level domain).
asset_count BIGINT
Number of assets assigned to the domain.
owners VARCHAR[]
Owner URNs.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Domains by asset count

SELECT name, asset_count
FROM datahub.main.domains
ORDER BY asset_count DESC;
Link
glossary_nodes 1 example7 cols

Glossary nodes (term groups) and their hierarchy

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Glossary node URN.
namenot null VARCHAR
Node name.
description VARCHAR
What the node groups.
parent_node_id VARCHAR
URN of the parent node (NULL at the root).
parent_path VARCHAR[]
Parent node names from the root down.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Terms directly under each glossary node

SELECT n.name, count(t.id) AS terms
FROM datahub.main.glossary_nodes n
LEFT JOIN datahub.main.glossary_terms t ON t.parent_node_id = n.id
GROUP BY n.name
ORDER BY n.name;
Link
glossary_terms 1 example14 cols

Business glossary terms with definitions and their place in the glossary hierarchy

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Glossary term URN.
namenot null VARCHAR
Term name.
hierarchical_name VARCHAR
Dotted name including parent nodes.
description VARCHAR
The term's definition.
term_source VARCHAR
'INTERNAL' or 'EXTERNAL'.
source_ref VARCHAR
External source reference (e.g. a FIBO id).
source_url VARCHAR
External source URL.
parent_node_id VARCHAR
URN of the immediate parent glossary node.
parent_path VARCHAR[]
Parent node names from the root down.
owners VARCHAR[]
Owner URNs.
domain_id VARCHAR
Domain URN.
domain VARCHAR
Domain name.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Terms per top-level glossary node

SELECT parent_path[1] AS top_node, count(*) AS terms
FROM datahub.main.glossary_terms
GROUP BY top_node
ORDER BY terms DESC;
Link
groups 1 example8 cols

DataHub groups (teams) that can own assets

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Group URN, e.g. 'urn:li:corpGroup:data-eng'.
namenot null VARCHAR
Group name.
display_name VARCHAR
Human-friendly group name shown in the UI.
description VARCHAR
What the team does.
email VARCHAR
Group email.
slack VARCHAR
Slack channel.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Assets owned per team

SELECT g.name, count(o.entity_id) AS owned
FROM datahub.main.groups g
LEFT JOIN datahub.main.owners o ON o.owner_id = g.id
GROUP BY g.name
ORDER BY owned DESC;
Link
incidents 1 example18 cols

Data incidents raised on datasets (manual or from failing assertions)

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Incident URN.
dataset_idnot null VARCHAR
URN of the dataset (datasets.id).
platform VARCHAR
Data platform of the dataset.
qualified_name VARCHAR
Lower-cased database.schema.table of the dataset.
incident_type VARCHAR
FRESHNESS, VOLUME, FIELD, SQL, DATA_SCHEMA, OPERATIONAL or CUSTOM.
custom_type VARCHAR
Name of a CUSTOM incident type.
title VARCHAR
One-line summary of the problem.
description VARCHAR
Details of the problem and its impact.
state VARCHAR
ACTIVE or RESOLVED.
stage VARCHAR
TRIAGE, INVESTIGATION, WORK_IN_PROGRESS, FIXED, NO_ACTION_REQUIRED, ...
priority VARCHAR
LOW, MEDIUM, HIGH or CRITICAL.
source_type VARCHAR
MANUAL or ASSERTION_FAILURE.
created_at TIMESTAMP WITH TIME ZONE
When the incident was raised.
started_at TIMESTAMP WITH TIME ZONE
When the problem started, if reported.
updated_at TIMESTAMP WITH TIME ZONE
Last status change.
created_by VARCHAR
URN of whoever raised it.
url VARCHAR
Link to the dataset in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Open incidents, newest first (state pushes down)

SELECT qualified_name, title, priority, created_at
FROM datahub.main.incidents
WHERE state = 'ACTIVE'
ORDER BY created_at DESC;
Link
lineage_edges 2 examples18 cols

Every lineage edge, upstream to downstream, at dataset and column level

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
levelnot null VARCHAR
'dataset' (entity-to-entity) or 'column' (column-to-column).
upstream_idnot null VARCHAR
URN of the upstream (source) entity.
upstream_type VARCHAR
Upstream entity type: dataset, data_job, chart, ...
upstream_platform VARCHAR
Platform the upstream entity lives on, e.g. snowflake, airflow.
upstream_name VARCHAR
Upstream display name.
upstream_qualified_name VARCHAR
Lower-cased database.schema.table when upstream is a dataset.
upstream_column VARCHAR
Upstream column (column level only).
downstream_idnot null VARCHAR
URN of the downstream (derived) entity.
downstream_type VARCHAR
Downstream entity type: dataset, data_job, chart, dashboard.
downstream_platform VARCHAR
Platform the downstream entity lives on, e.g. snowflake, looker.
downstream_name VARCHAR
Downstream display name.
downstream_qualified_name VARCHAR
Lower-cased database.schema.table when downstream is a dataset.
downstream_column VARCHAR
Downstream column (column level only).
relationship VARCHAR
DataHub relationship for dataset-level edges: DownstreamOf, Consumes, Produces, ...
transformation VARCHAR
Column-level transform operation (e.g. 'IDENTITY', 'SQL').
query_id VARCHAR
URN of the query that created a column-level edge, if known.
created_at TIMESTAMP WITH TIME ZONE
When the edge was first recorded (dataset level).
Examples (2)

Where each column of one table comes from (downstream_id pushes down)

SELECT upstream_qualified_name, upstream_column, downstream_column
FROM datahub.main.lineage_edges
WHERE level = 'column' AND downstream_id = 'urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.marts.fct_orders,PROD)'
ORDER BY downstream_column;

Lineage edges by downstream entity type

SELECT downstream_type, count(*) AS edges
FROM datahub.main.lineage_edges
WHERE level = 'dataset'
GROUP BY downstream_type
ORDER BY edges DESC;
Link
operations 1 example11 cols

Write operations on datasets (inserts, updates, DDL) as reported to DataHub

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
dataset_idnot null VARCHAR
URN of the dataset (datasets.id).
platform VARCHAR
Data platform of the dataset.
qualified_name VARCHAR
Lower-cased database.schema.table of the dataset.
reported_atnot null TIMESTAMP WITH TIME ZONE
When the operation was reported to DataHub.
operation_at TIMESTAMP WITH TIME ZONE
When the operation happened on the source platform.
operation_type VARCHAR
INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, CUSTOM or UNKNOWN.
custom_operation_type VARCHAR
Name of a CUSTOM operation.
source_type VARCHAR
DATA_PROCESS or DATA_PLATFORM: who reported it.
actor VARCHAR
URN of the user / job that performed it.
affected_rows BIGINT
Number of rows the operation changed (count of rows), when reported.
Example

Last write per dataset (stalest first)

SELECT qualified_name, max(operation_at) AS last_write
FROM datahub.main.operations
GROUP BY qualified_name
ORDER BY last_write;
Link
owners 1 example12 cols

Who owns what: one row per (entity, owner) with the ownership type

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
entity_idnot null VARCHAR
URN of the owned entity.
entity_typenot null VARCHAR
Owned entity type: dataset, dashboard, chart, data_flow, data_job, container, domain, data_product, glossary_term, glossary_node or tag.
entity_name VARCHAR
Name of the owned entity.
qualified_name VARCHAR
Lower-cased database.schema.table when the entity is a dataset.
owner_idnot null VARCHAR
Owner URN (urn:li:corpuser:... or urn:li:corpGroup:...).
owner_typenot null VARCHAR
'user' or 'group'.
owner_name VARCHAR
Username (users) or group name (groups).
owner_display_name VARCHAR
Display name.
owner_email VARCHAR
Email address, when known.
ownership_type VARCHAR
Ownership type: the custom type's name (e.g. 'Technical Owner') or the legacy enum (TECHNICAL_OWNER, BUSINESS_OWNER, DATA_STEWARD, ...).
ownership_type_id VARCHAR
URN of the ownership type entity.
Example

Datasets owned per person or group

SELECT owner_name, count(*) AS datasets
FROM datahub.main.owners
WHERE entity_type = 'dataset'
GROUP BY owner_name
ORDER BY datasets DESC;
Link
tags 1 example6 cols

Tag definitions (the tags lists on assets and columns hold their names)

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
Tag URN, e.g. 'urn:li:tag:pii'.
namenot null VARCHAR
Tag name (the display name when set).
description VARCHAR
What the tag means and when to apply it.
color VARCHAR
Hex colour, e.g. '#FF0000'.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

How many columns carry each tag

SELECT t.name, count(c.column_name) AS tagged_columns
FROM datahub.main.tags t
LEFT JOIN datahub.main.columns c ON list_contains(c.tags, t.name)
GROUP BY t.name
ORDER BY tagged_columns DESC;
Link
usage 1 example11 cols

Dataset usage statistics: query counts, distinct users, top users and top columns

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
dataset_idnot null VARCHAR
URN of the dataset (datasets.id).
platform VARCHAR
Data platform of the dataset.
qualified_name VARCHAR
Lower-cased database.schema.table of the dataset.
time_rangenot null VARCHAR
Window of the statistics: DAY, WEEK, MONTH (default), QUARTER, HALF_YEAR, YEAR or ALL. Filter time_range = '<value>' to choose it.
query_count BIGINT
Queries that touched the dataset in the window.
unique_user_count BIGINT
Distinct users that queried it in the window.
top_users STRUCT of 4 fields[]
Users by query count: user_id, username, email, query_count.
STRUCT[] 4 fields
  • user_idVARCHAR
  • usernameVARCHAR
  • emailVARCHAR
  • query_countBIGINT
top_columns STRUCT(column_name VARCHAR, query_count BIGINT)[]
Columns by query count: column_name, query_count.
query_count_last_30_days BIGINT
DataHub's 30-day query count summary.
unique_user_count_last_30_days BIGINT
DataHub's 30-day distinct user summary.
ConstraintsPRIMARY KEY (dataset_id)
Example

The ten most-queried datasets this month

SELECT qualified_name, query_count, unique_user_count
FROM datahub.main.usage
WHERE time_range = 'MONTH'
ORDER BY query_count DESC
LIMIT 10;
Link
users 1 example9 cols

DataHub users (corp users) with name, email, title and department

Columns
catalog_toolnot null VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
idnot null VARCHAR
User URN, e.g. 'urn:li:corpuser:jdoe'.
usernamenot null VARCHAR
Login name, the part after urn:li:corpuser:.
display_name VARCHAR
Display name (UI-edited first).
email VARCHAR
Email address.
title VARCHAR
Job title.
department VARCHAR
Department name.
active BOOLEAN
True unless the user is suspended or inactive in the source directory.
url VARCHAR
Link in the DataHub UI.
ConstraintsPRIMARY KEY (id)
Example

Assets owned per user

SELECT u.display_name, count(o.entity_id) AS owned
FROM datahub.main.users u
LEFT JOIN datahub.main.owners o ON o.owner_id = u.id
GROUP BY u.display_name
ORDER BY owned DESC;
Link
Scalar functions
dataset_qualified_name (urn VARCHAR) 2 examples

The lower-cased database.schema.table join key of a DataHub dataset URN

Arguments
urn VARCHAR
The DataHub dataset URN to read (datasets.id, lineage_edges.upstream_id, ...); NULL gives NULL.
ReturnsVARCHAR
Examples (2)

Most-consumed upstream datasets by qualified name

SELECT datahub.main.dataset_qualified_name(upstream_id) AS source,
  count(*) AS consumers
FROM datahub.main.lineage_edges
WHERE level = 'dataset' AND upstream_type = 'dataset'
GROUP BY ALL
ORDER BY consumers DESC;
SELECT datahub.main.dataset_qualified_name('urn:li:dataset:(urn:li:dataPlatform:snowflake,ANALYTICS.Marts.FCT_ORDERS,PROD)') AS snowflake_table,
  datahub.main.dataset_qualified_name('urn:li:dataset:(urn:li:dataPlatform:kafka,Orders.Events,PROD)') AS kafka_topic;
Link
dataset_urn (platform VARCHAR, name VARCHAR, environment VARCHAR) +1 overload 3 examples

Build a PROD DataHub dataset URN from a platform and a dataset name

Arguments
platform VARCHAR
Platform name, e.g. 'snowflake' (or its urn:li:dataPlatform: URN); NULL in, NULL out.
name VARCHAR
Dataset name as DataHub stores it, e.g. 'analytics.marts.fct_orders'; NULL in, NULL out.
environment VARCHAR
Environment (DataHub FabricType), a constant such as 'PROD' or 'dev'; case-insensitive.
Overloads
dataset_urn(platform VARCHAR, name VARCHAR) β†’ VARCHARdataset_urn(platform VARCHAR, name VARCHAR, environment VARCHAR) β†’ VARCHAR
ReturnsVARCHAR
Examples (3)

A table's columns, looked up by platform and name

SELECT column_name, native_data_type
FROM datahub.main.columns
WHERE dataset_id = datahub.main.dataset_urn('snowflake', 'analytics.marts.fct_orders')
ORDER BY ordinal_position;

Look up a DEV table by platform and name

SELECT qualified_name, environment
FROM datahub.main.datasets
WHERE id = datahub.main.dataset_urn('bigquery', 'proj.ds.events', 'dev');
SELECT datahub.main.dataset_urn('bigquery', 'proj.ds.events', 'dev') AS urn;
Link
parse_dataset_urn (urn VARCHAR) 2 examples

Split a DataHub dataset URN into platform, name, environment, database, schema and table

Arguments
urn VARCHAR
The DataHub dataset URN to read (datasets.id, lineage_edges.upstream_id, ...); NULL gives NULL.
ReturnsSTRUCT of 7 fields
STRUCT 7 fields
  • platformVARCHAR
  • nameVARCHAR
  • environmentVARCHAR
  • databaseVARCHAR
  • schemaVARCHAR
  • table_nameVARCHAR
  • qualified_nameVARCHAR
Examples (2)

Lineage edges per upstream platform

SELECT datahub.main.parse_dataset_urn(upstream_id).platform AS platform,
  count(*) AS edges
FROM datahub.main.lineage_edges
WHERE upstream_type = 'dataset'
GROUP BY ALL
ORDER BY edges DESC;
SELECT p.platform, p.environment, p.schema
FROM (SELECT datahub.main.parse_dataset_urn('urn:li:dataset:(urn:li:dataPlatform:snowflake,ANALYTICS.Marts.FCT_ORDERS,PROD)') AS p);
Link
Table functions
lineage (id VARCHAR, direction := VARCHAR, max_hops := BIGINT) 2 examples

Multi-hop upstream or downstream lineage of one entity (impact analysis)

Positional arguments
id VARCHAR
URN of the start entity (a dataset, chart, dashboard or data job id).
Named arguments
direction := VARCHAR
'upstream' (what it depends on) or 'downstream' (impact). Β· default "upstream"
max_hops := BIGINT
Maximum lineage distance to follow; 1 to 20. Β· default 3
Returns columns
catalog_tool VARCHAR
Catalog that produced the row; always 'datahub' (UNION key).
start_id VARCHAR
The start entity URN (the id argument).
direction VARCHAR
'upstream' or 'downstream'.
id VARCHAR
URN of the reached entity.
entity_type VARCHAR
Reached entity type: dataset, data_job, chart, dashboard, ...
name VARCHAR
Display name.
platform VARCHAR
Platform.
qualified_name VARCHAR
Lower-cased database.schema.table for datasets.
degree INTEGER
Hops from the start entity (1 = direct).
paths VARCHAR[][]
Paths of URNs from the start entity to this one.
url VARCHAR
Link in the DataHub UI.
Examples (2)

Every dataset a table depends on, nearest first

SELECT qualified_name, degree
FROM datahub.main.lineage('urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.marts.fct_orders,PROD)')
WHERE entity_type = 'dataset'
ORDER BY degree, qualified_name;

Charts and dashboards affected by a change to a raw table

SELECT entity_type, name
FROM datahub.main.lineage('urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.raw.orders,PROD)', direction := 'downstream', max_hops := 5)
WHERE entity_type IN ('chart', 'dashboard')
ORDER BY name;
Link

Credentials

The secret type datahub declares, as reported by the worker itself.

datahub

How to get these credentials

Connection to a DataHub (open-source or DataHub Cloud) metadata service: GMS_URL and/or FRONTEND_URL plus a personal access TOKEN.

secret.sql
CREATE SECRET datahub (
    TYPE datahub,
    gms_url      '<gms_url>',
    frontend_url '<frontend_url>',
    token        '<DATAHUB_TOKEN>',  -- secret
    page_size    '<page_size>'
);
Key Type Required Description
gms_url VARCHAR β€” DataHub GMS (metadata service) root, e.g. 'http://localhost:8080' or 'https://<tenant>.acryl.io/gms'. GraphQL is POSTed to <gms_url>/api/graphql.
frontend_url VARCHAR β€” DataHub UI root, e.g. 'http://localhost:9002'. Used for row links (url column); when GMS_URL is unset, GraphQL goes to <frontend_url>/api/v2/graphql.
token secret VARCHAR β€” Personal access token (Settings > Access Tokens), sent as 'Authorization: Bearer <token>'. Leave unset only for a DataHub with metadata-service authentication disabled.
page_size VARCHAR β€” Entities requested per scroll page; 1 to 1000, default 100.

The worker doesn't mark which keys are required.

Needed by searchlineage

Create the secret in the same session, after attaching datahub β€” the worker registers its secret types at ATTACH. Keys marked secret are masked in duckdb_secrets(); angle-bracket values are placeholders. Read credentials from your environment or secret store in your application and pass them through your SQL client’s parameter bindings. Keep real values out of saved SQL and history. Native DuckDB and Haybarn do not provide a SQL getenv() function.

Try these queries

Datasets nobody owns

SELECT qualified_name, domain
FROM datahub.main.datasets
WHERE len(owners) = 0 AND NOT deprecated
ORDER BY qualified_name

Uses datasets

Columns tagged PII

SELECT qualified_name, column_name
FROM datahub.main.columns
WHERE list_contains(tags, 'pii')
ORDER BY qualified_name, column_name

Uses columns

Dashboards per BI tool and how many lack an owner

SELECT platform, count(*) AS dashboards,
  count(*) FILTER (WHERE len(owners) = 0) AS unowned
FROM datahub.main.dashboards
GROUP BY platform
ORDER BY dashboards DESC

Uses dashboards

The datasets each chart reads

SELECT c.name, e.upstream_qualified_name
FROM datahub.main.charts c
JOIN datahub.main.lineage_edges e ON e.downstream_id = c.id
WHERE e.level = 'dataset'
ORDER BY c.name

Uses chartslineage_edges

Tasks per pipeline

SELECT f.name, count(j.id) AS tasks
FROM datahub.main.data_flows f
LEFT JOIN datahub.main.data_jobs j ON j.flow_id = f.id
GROUP BY f.name
ORDER BY tasks DESC

Uses data_flowsdata_jobs

Which datasets each Airflow task writes

SELECT name, unnest(output_dataset_ids) AS writes
FROM datahub.main.data_jobs
WHERE platform = 'airflow'
ORDER BY name

Uses data_jobs

29 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Using the DataHub catalog, how many Snowflake datasets are there in each schema?
  • List the qualified name and column name of every dataset column tagged 'pii' in DataHub.
  • Which datasets in DataHub have an assertion whose latest run failed?
  • Using DataHub lineage, list every dataset upstream of the Snowflake table analytics.marts.fct_orders (any number of hops), by qualified name.
  • List the names of the schema containers in DataHub.
  • How many views does each Looker dashboard in DataHub have?

DataHub is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.