---
title: Existing table
description: Ingest an existing Unity Catalog Delta table or view into a Lakewatch datasource without copying the data.
canonical_url: https://docs.databricks.com/aws/en/lakewatch/ingest-data/ingestion-methods/existing-table
---

# Existing table

> [!NOTE]
> **Beta**
>
> Lakewatch is in [Beta](https://docs.databricks.com/aws/en/release-notes/release-types.md). Workspace admins can control access to this feature from the **Previews** page. See [ Manage workspace-level previews](https://docs.databricks.com/aws/en/admin/workspace-settings/manage-previews.md#workspace).

Use the **Existing table** ingestion method to ingest a Unity Catalog Delta table or view that already exists in your workspace. Lakewatch reads the source table directly and runs your attached parsers over it to produce parsed tables, rather than copying the data.

> [!NOTE]
>
> You don't have to ingest a table to use it in Lakewatch. If a Unity Catalog table is already query-ready, you can run [queries](https://docs.databricks.com/aws/en/lakewatch/queries/index.md) and write [detection rules](https://docs.databricks.com/aws/en/lakewatch/detections/choose-detection-rule-type.md) against it directly, without creating a datasource. Use the **Existing table** method when you want Lakewatch to run parsers over the source and produce normalized parsed tables, with the Lakewatch-managed `lw_id`, `lw_meta`, and `lw_observables` columns.
>
> For example, query the [audit log system table](https://docs.databricks.com/aws/en/admin/system-tables/audit-logs.md) (`system.access.audit`) directly. The built-in **Databricks Audit** parser reads the JSON files that [audit log delivery](https://docs.databricks.com/aws/en/admin/account-settings/audit-log-delivery.md) writes, not the system table, which uses different column names. If you attach it to `system.access.audit`, the data preview shows `source table 'system.access.audit' is not compatible with the parser: missing required fields: 'serviceName', 'actionName'`.

This page is the complete guide to creating a datasource from an existing table. For managing a datasource after it exists (editing settings, changing parsers, and monitoring) see [Create and manage datasources](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md).

The source can be a managed or external Delta table, a streaming table, an OpenSharing table, or a view that reads from a single upstream table. The view can use only `SELECT` and `WHERE` over that table. For example, views that join tables, combine them with `UNION ALL` or another set operation, or use `GROUP BY`, `DISTINCT`, `ORDER BY`, or a `WITH` clause aren't supported. Materialized views and metric views aren't supported.

Lakewatch processes only rows appended to the source. Updates and deletes in the source aren't applied to the parsed tables. Lakewatch skips any commit that updates or deletes existing rows, including rows inserted by that same commit, such as a `MERGE` that both updates and inserts rows. If rows that Lakewatch already processed change in the source, the parsed tables keep the earlier values.

## Create the datasource

From **Datasources**, select **Add datasource**. Under **Custom & internal logs**, select **Unity Catalog table**.

Fill out the following fields on the setup page:

* **Name**: Enter a unique name for the datasource.
* **Source table**: Enter the fully qualified name of the existing Unity Catalog table or view, in `catalog.schema.table` format, or select **Browse tables** to find one.

Set the [run-as identity](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#set-the-run-as-identity) for the datasource. **Data preview** starts collapsed. To open it and sample rows from the selected table, select **Test parsers** in the **Data preview** panel. You can preview source rows before attaching a parser.

Expand **Advanced settings** to configure the following settings:

* **Schedule**: How often the ingestion job runs. Defaults to at least every 10 minutes. Change it later on the **Configuration** tab.
* **Only process new rows**: Controls whether Lakewatch backfills the rows already in the source table. It's on by default, so Lakewatch starts from the source table's latest version when you create the datasource and skips the earlier history. Turn it off to also ingest the rows already present (a backfill that takes longer on a large source), then continue with newly appended rows. This setting takes effect only at first start and can't be changed after creation. For OpenSharing tables, turn this option off. A shared table has no version to start from, so Lakewatch can't skip its existing rows, and creating the datasource fails while the option is on. With the option off, Lakewatch processes all rows.
* **Performance optimized**: Use performance-optimized compute for faster ingestion (on) or standard compute (off). Defaults to the [environment's ingestion-compute default](https://docs.databricks.com/aws/en/lakewatch/admin/workspace-config.md).

You can't change the source table after the datasource is created. To change it, recreate the datasource.

> [!NOTE]
>
> Queries and detection rules that read the datasource perform best when the source table is liquid-clustered on the column used for `time`. If that column is a top-level `TIMESTAMP` or `TIMESTAMP_NTZ` column, add clustering directly on the source table by running `ALTER TABLE catalog.schema.my_source_table CLUSTER BY (my_time_column)` in a notebook or SQL editor, where `my_time_column` is the source table's time column. See [Enable liquid clustering on existing tables](https://docs.databricks.com/aws/en/tables/clustering.md#enable-existing-table).
>
> If the time column isn't a top-level column, isn't a `TIMESTAMP` or `TIMESTAMP_NTZ` type, or is derived by a SQL expression, clustering can't be added directly.

## Attach parsers and create the datasource

1. Attach one or more parsers to schematize the ingested data: a built-in parser that matches your source or one you authored. For how parser matching works and the columns parsers produce, see [Parsers](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#parsers).
2. Select **Create datasource**. The datasource starts running immediately on its processing schedule. To stop it, [delete the datasource](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#manage-existing-datasources).

After creation, edit the datasource's other settings (schedule, compute, and annotations) at any time on its **Configuration** tab. See [Edit datasource settings](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#edit-datasource-settings).

## Ingest Unity Gateway trace logs

[Unity Gateway unified tracing](https://docs.databricks.com/aws/en/ai-gateway/unified-trace-table.md) records model and tool requests (including guardrail and policy decisions, token usage, and requester identity) to a Unity Catalog Delta table (`unity_gateway_otel_spans`) that you own. Because it's a standard Unity Catalog table, you can bring it into Lakewatch with the **Existing table** method and then query and run detection rules against it.

1. Set up the trace table for your metastore in the Unity Gateway UI. See [Monitor all AI activity using the unified trace table](https://docs.databricks.com/aws/en/ai-gateway/unified-trace-table.md).
2. Follow the preceding steps to create the datasource, using the trace table's fully qualified name as the **Source table**.
3. Grant the datasource's [run-as identity](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#set-the-run-as-identity) access to read the trace table and write to the destination schema. A detection rule you write against the data runs under its own run-as identity, which needs the same access.

To query the trace table without creating a datasource, use the [query page](https://docs.databricks.com/aws/en/lakewatch/queries/index.md) or a detection rule.
