Skip to content

Start the app

In order for users to run PyRel programs that depend on the RAI Native App for Snowflake, the app service must be active and ready. Use this guide to bring the app online after installation or downtime.

When you start the app:

  • The RAI Native App service in Snowflake is turned on so users can run PyRel programs.
  • The app’s compute pools are provisioned, the CDC service is resumed, and reasoners are made available to evaluate queries from semantic models.

Call the activation procedure to start the app

Section titled “Call the activation procedure to start the app”

Select the tab for your preferred language to see how to start the RAI Native App.

Use the relationalai.app.activate() procedure:

CALL relationalai.app.activate();
Output
+----------------------------------------------+
| RelationalAI service activated successfully. |
| The service may still be starting up; check. |
| that the service is running by calling the. |
| APP.SERVICE_STATUS() procedure to check for |
| the READY status. |
+----------------------------------------------+

Fix app activation errors caused by Snowflake account settings

Section titled “Fix app activation errors caused by Snowflake account settings”

If CALL relationalai.app.activate(); returns an error instead of starting the app, a Snowflake account setting may be blocking it. The most common cause is the account parameter PREVENT_UNLOAD_TO_INTERNAL_STAGES. When this parameter is enabled, activation fails with an error saying that PREVENT_UNLOAD_TO_INTERNAL_STAGES is stopping the RAI Native App from writing to its internal stage.

An internal stage is a temporary storage area inside Snowflake. When PREVENT_UNLOAD_TO_INTERNAL_STAGES is TRUE, the app can’t write to its own internal stage. This blocks the CDC service and data streams that load your data, so activation stops instead of starting the app in a broken state.

To fix the error, complete one of the options below, then run CALL relationalai.app.activate(); again.

What to doWhen to do it
Enable internal stage unloads for the RAI app onlyYou want to keep PREVENT_UNLOAD_TO_INTERNAL_STAGES enabled for the rest of your account.
Disable the setting account-wideYou can disable the parameter for the whole account.

After activation succeeds, confirm the app is ready by following Check that the RAI service is running.

Enable internal stage unloads for the RAI app only

Section titled “Enable internal stage unloads for the RAI app only”

This is Snowflake’s recommended approach. It applies only to the app’s own stages and doesn’t change PREVENT_UNLOAD_TO_INTERNAL_STAGES for the rest of your account, so your account-wide protection stays in place.

  1. Open the RelationalAI app in the Snowflake web interface.

    Sign in to the Snowflake web interface (Snowsight) and open the installed RelationalAI Native App.

  2. Approve the internal stage unload request.

    Review the app’s request to enable internal stage unloads (the ENABLE_RAI_INTERNAL_STAGE_UNLOAD specification) and approve it. For the exact steps, see Review specifications for an app in the Snowflake documentation.

Disable PREVENT_UNLOAD_TO_INTERNAL_STAGES account-wide

Section titled “Disable PREVENT_UNLOAD_TO_INTERNAL_STAGES account-wide”

Ask an ACCOUNTADMIN to disable the parameter for the whole account:

ALTER ACCOUNT SET PREVENT_UNLOAD_TO_INTERNAL_STAGES = FALSE;

After activation succeeds, confirm the app is ready by following Check that the RAI service is running.