Skip to content

Enable the CDC service

The RAI Native App creates a Change Data Capture (CDC) service to manage a compute engine responsible for processing changes from Snowflake source tables and views. This guide explains how to enable and disable the CDC service, check its status, and resize its engine when needed.

  • The RAI Native App is installed in your Snowflake account.

The CDC service manages a compute engine that processes the change tracking data consumed by data streams to make changes to source data available to semantic models that depend on the streams’ data sources. This service fully manages the lifecycle of the CDC engine, including creating or resuming it when changes are detected and suspending it after inactivity.

Enable CDC when you want the service to start processing source-data changes again. Use this task when you are turning CDC on for the first time or resuming it after a pause.

-- Enable the CDC service.
CALL relationalai.app.resume_cdc();
Output
+--------------------------------------------------------------------+
| CDC functionality on the RelationalAI application has been resumed |
+--------------------------------------------------------------------+

Use this task after you enable or resume CDC. Run app.cdc_status() to confirm the CDC service is ready to process changes:

-- Get the CDC service status.
CALL relationalai.app.cdc_status();
Output
+--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------+
| CDC_ENABLED | CDC_ENGINE_NAME | CDC_ENGINE_STATUS | CDC_ENGINE_SIZE | CDC_TASK_STATUS | CDC_TASK_INFO |
|--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------|
| TRUE | CDC_MANAGED_ENGINE | READY | HIGHMEM_X64_S | started | {"status": "started", "created_on": "2024-10-15 21:58:11.291 -0700", "last_suspended_on": null, "last_suspension_reason": null} |
+--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------+

The CDC service is ready when you see:

  • CDC_ENABLED: TRUE — the CDC service is enabled.
  • CDC_TASK_STATUS: started — the CDC processing scheduler is running.
  • CDC_ENGINE_STATUS: READY or SUSPENDED — both are normal. READY means the engine is actively processing changes; SUSPENDED means it’s idle and will resume automatically when new changes arrive.

If anything is not ready, find your situation below:

What you seeWhat to do
app.cdc_status() returns an error saying the app is not activeStart the RAI Native App, then recheck.
CDC_ENABLED is FALSEEnable the CDC service, then recheck.
CDC_ENGINE_STATUS is PENDINGThe CDC engine is starting up. Wait a moment and recheck. If it doesn’t change, contact your RAI administrator.
CDC_TASK_STATUS is not startedEnable the CDC service again, then recheck. If it’s still not started, the app may be missing the EXECUTE TASK and EXECUTE MANAGED TASK Snowflake privileges. Review Install the RAI Native App to restore those grants.
Everything looks healthy, but recent Snowflake changes aren’t showing up in your model resultsThe CDC service is set up correctly. See Troubleshoot common data stream issues to help you track down the issue.

Run app.cdc_status(), then check CDC_ENGINE_SIZE. Use this when you want to confirm which engine size is active or verify that a resize took effect.

Run app.cdc_status():

-- Get the CDC service status.
CALL relationalai.app.cdc_status();
Output
+--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------+
| CDC_ENABLED | CDC_ENGINE_NAME | CDC_ENGINE_STATUS | CDC_ENGINE_SIZE | CDC_TASK_STATUS | CDC_TASK_INFO |
|--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------|
| TRUE | CDC_MANAGED_ENGINE | READY | HIGHMEM_X64_S | started | {"status": "started", "created_on": "2024-10-15 21:58:11.291 -0700", "last_suspended_on": null, "last_suspension_reason": null} |
+--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------+
  • The CDC_ENGINE_SIZE column shows the current size of the CDC engine, such as HIGHMEM_X64_S or HIGHMEM_X64_M.

Resize the CDC engine when the default size is not sufficient for your workload, such as when change batches are large or processing latency is too high. The new size takes effect the next time a new processing batch starts.

When the RAI Native App is installed, the CDC engine starts with the HIGHMEM_X64_S size. See Compute Pools for background on the available size options.

To change the size of the CDC engine, use the app.alter_cdc_engine_size() procedure:

-- Change the size of the CDC engine to HIGHMEM_X64_M.
CALL relationalai.app.alter_cdc_engine_size('HIGHMEM_X64_M');
Output
+--------------------------------------+
| CDC engine size set to HIGHMEM_X64_M |
+--------------------------------------+

Disable CDC when you need to pause data stream processing, such as when you are investigating a problem or want to reduce costs during a period of inactivity. When CDC is disabled, the service suspends the CDC engine, which pauses all stream change processing until you re-enable CDC.

To disable the CDC service, use the app.suspend_cdc() procedure:

-- Disable the CDC service.
CALL relationalai.app.suspend_cdc();
Output
+------+
| NULL |
+------+