> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clarityq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Up Your Table Catalog

> How to select tables and run the initial discovery process.

After you [connect your data warehouse](https://docs.clarityq.ai/get-started/connect-your-data-warehouse.md), the setup wizard directs you to the Table Catalog. From here, you add the tables you want ClarityQ to catalog.

## Adding Tables

Click **Add Tables** in the Table Catalog to open the table selection wizard. The wizard walks you through three steps:

**1. Select tables**

Browse your warehouse's schemas and choose the tables you want ClarityQ to catalog. You don't need to add all tables — focus on the ones relevant to your analytics.

**2. Define mandatory filters (optional)**

Set SQL WHERE conditions that are automatically applied to every query ClarityQ runs against the selected tables. Useful for scoping to a specific product, excluding deleted records, or filtering out stale data. See [Mandatory Filters](#mandatory-filters) below.

**3. View added tables**

See a summary of the tables that were added to your catalog.

The Table Catalog page then displays the tables you added, along with their discovered schemas, columns, and metadata.

> [!NOTE]
>
> Your organization's admin sets a **maximum number of tables** that can be added to a workspace's context. The agent only uses tables that are in the Table Catalog — tables in your warehouse that haven't been added are invisible to ClarityQ.

> [!TIP]
>
> Start with your most important tables — the ones your team queries most often. You can always add more tables later by clicking **Add Tables** again.

## What Happens During Discovery

When you add tables, ClarityQ runs a discovery workflow for each one:

1. **Schema extraction** — Queries your warehouse for the table's structure, columns, data types, and constraints
2. **Column value sampling** — Fetches up to 50 distinct values for categorical columns
3. **Metadata collection** — Captures row counts, table size, partitioning, clustering, and timestamps
4. **AI description generation** — Automatically suggests descriptions for tables and columns that don't have one

Discovery runs in parallel across multiple tables. Each table's state is tracked independently — you'll see an **In Progress** spinner while it's running, a **Completed** checkmark when done, or an **Error** indicator if something went wrong.

## Mandatory Filters

Mandatory filters let you define SQL WHERE conditions that are **automatically applied to every query** ClarityQ runs against your tables. They're useful for scoping your data — for example, restricting to a specific product, excluding deleted records, or filtering out stale data.

**Examples:**

```sql theme={null}
bundle_id = 'com.myapp'
```

```sql theme={null}
is_deleted = false AND created_at >= '2024-01-01'
```

### When to use them

* You have multi-tenant tables and want ClarityQ to only see data for your product
* You need to exclude test data, deleted records, or irrelevant rows
* You want to limit the date range ClarityQ queries to avoid scanning historical data you don't need

### How they work

* **Set during table selection** — The table selection wizard lets you define mandatory filters that apply to all newly added tables.
* **Edit per table** — After setup, you can adjust filters for individual tables from the table settings.
* **Validated before saving** — ClarityQ runs a dry-run validation against your warehouse to make sure the filter syntax is correct.
* **Enforced automatically** — Every query ClarityQ generates for a filtered table includes these conditions in the WHERE clause. Users don't see or need to think about them.

> [!WARNING]
>
> Mandatory filters set during table selection apply only to **newly added tables**. Existing tables are not affected — edit their filters individually from the table settings.

## Table Settings

After a table is cataloged, you can configure it from the table settings:

* **Table type** — Classify the table (Events, Fact, Dimension, Lookup, Aggregate, Raw Data). This affects how ClarityQ uses the table.
* **Mandatory filters** — Edit the SQL WHERE conditions for this specific table.
* **Analytics engine** — For Events tables, specify the analytics platform (e.g., GA4) to enable platform-specific enrichment.
* **Descriptions** — Edit table and column descriptions, or accept AI-generated suggestions.

## Reviewing Tables and Columns

After discovery, tables and columns start in **Pending** status. Review them to confirm they're accurate:

* **Approve** tables and columns you've reviewed
* **Hide** columns that are irrelevant or sensitive — they won't appear in the catalog or be used by the agent
* **Edit descriptions** to add business context that helps ClarityQ understand what the data means


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.