Tables & References
Table & reference tools
Tools for warehouse metadata and the queries hitting a table: look up a table or view by fully-qualified name, resolve a partial or ambiguous reference into a canonical FQN, list the queries that ran against a table, and inspect per-column schema and cardinality. For column-usage frequency and table storage-overview metrics, see Table & Column Usage.
All table tools accept a 3-part (db.schema.table) or 2-part (schema.table) name; a bare table name is rejected. A 2-part name resolves exactly when a default database is supplied, otherwise it is suffix-matched (multiple hits return as ambiguous with candidate FQNs).
All sample responses below use synthetic data.
table_detail
table_detailReturns physical metadata for a table or view by fully-qualified name. Accepts three-part (db.schema.table) or two-part (schema.table) names.
Sample call
"How big is analytics.orders_fact?"
Sample response (base table)
{
"table_type": "TABLE",
"row_count": 1400000000,
"bytes": 3100000000000,
"cluster_key": "(order_date, region)"
}Not found
{ "error": "No table found for fqn='analytics_db.analytics.does_not_exist'" }resolve_table_reference
resolve_table_referenceCanonicalizes a 1-, 2-, or 3-part name to a fully-qualified table or view, returning physical metadata and (for views) the SQL definition and underlying physical sources.
Resolution behavior
- 3-part FQN → exact match
- 2-part with a known default database → concatenated then exact match
- Otherwise → suffix match; multiple hits return as
ambiguouswith candidate FQNs
Sample call
"What does
ordersactually refer to?"
Sample response — base table
{
"input": "orders_fact",
"fqn": "analytics_db.analytics.orders_fact",
"table_type": "TABLE",
"row_count": 1400000000,
"bytes": 3100000000000,
"cluster_key": "(order_date, region)"
}Sample response — view
{
"input": "analytics.orders_recent",
"fqn": "analytics_db.analytics.orders_recent",
"table_type": "VIEW",
"row_count": null,
"bytes": null,
"cluster_key": null,
"definition": "SELECT * FROM analytics_db.analytics.orders_fact WHERE order_date >= CURRENT_DATE - 30",
"definition_truncated": false,
"definition_full_chars": 84,
"definition_distinct_versions": 1,
"physical_tables": [
{
"fqn": "analytics_db.analytics.orders_fact",
"row_count": 1400000000,
"bytes": 3100000000000,
"cluster_key": "(order_date, region)"
}
]
}Sample response — ambiguous
{
"input": "orders",
"ambiguous": true,
"candidates": [
{"fqn": "analytics_db.analytics.orders_fact", "table_type": "TABLE", "row_count": 1400000000, "bytes": 3100000000000, "cluster_key": "(order_date, region)"},
{"fqn": "analytics_db.staging.orders_raw", "table_type": "TABLE", "row_count": 1400000000, "bytes": 4200000000000, "cluster_key": null}
]
}Sample response — not found
{
"input": "does_not_exist",
"error": "No table found for 'does_not_exist'"
}table_query_list
table_query_listReturns the queries that referenced a table within a processing-time date range, ordered by cost (highest first), 20 rows per page. Answers "what is actually running against this table?" — the workloads any clustering, partitioning, or schema change will affect. start_date and end_date are inclusive YYYY-MM-DD bounds.
Sample call
"Which queries hit analytics.orders_fact between 2026-05-22 and 2026-05-29, and which cost the most?"
Sample response
[
{ "query_id": "01b2f9a4-7c3d-4e21-9a01-2f5b8c0d1e34", "cost": 12.47, "job_id": "job_8f3c1d", "processing_time": "2026-05-28T00:00:00Z", "signature": "a1c9e7f2" },
{ "query_id": "04e7c211-1b88-4f0a-8d22-6a90fb3c7d10", "cost": 3.10, "job_id": "job_2ab990", "processing_time": "2026-05-27T00:00:00Z", "signature": "9f02bd55" }
]Sample response — ambiguous
{
"ambiguous": true,
"candidates": ["analytics_db.analytics.orders_fact", "analytics_db.staging.orders_raw"]
}table_column_detail
table_column_detailReturns per-column metadata, one row per column ordered by position: field_name, data_type, cardinality, part_cluster. cardinality is the schema crawler's distinct-value estimate — read it as a magnitude signal: a column whose cardinality approaches the row count is a poor leading cluster key, while a low-cardinality column used often in filters is a strong candidate. part_cluster flags an existing partition/cluster role.
Sample call
"Show me the columns and cardinalities for analytics.orders_fact."
Sample response
[
{ "field_name": "order_id", "data_type": "NUMBER(38,0)", "cardinality": 1400000000, "part_cluster": null },
{ "field_name": "order_date", "data_type": "DATE", "cardinality": 730, "part_cluster": "CLUSTER" },
{ "field_name": "region", "data_type": "VARCHAR", "cardinality": 6, "part_cluster": "CLUSTER" }
]Next: Table & Column Usage →
Updated 8 days ago