cleanup_unused_data_stream_references()
relationalai.app
cleanup_unused_data_stream_references()A procedure that removes data stream source references that are no longer associated with any active data stream.
Use app.reference_audit() first to review which references will be removed before running this procedure.
Requires the rai_user application role.
Parameters
Section titled “Parameters”None.
Returns
Section titled “Returns”An ARRAY of objects, one per removed reference, each with the following fields:
| Field | Type | Description |
|---|---|---|
referenceName | STRING | The type of reference removed. One of DATA_STREAM_TABLE or DATA_STREAM_VIEW. |
referenceAlias | STRING | The internal alias of the removed reference. |
fqObjectName | STRING | The fully qualified name of the Snowflake table or view the reference pointed to. |
classification | STRING | Always UNUSED for references removed by this procedure. |
Example
Section titled “Example”Use app.reference_audit() to review unused references, then call app.cleanup_unused_data_stream_references() to remove them:
-- Review unused references firstCALL relationalai.app.reference_audit();
-- Remove all unused data stream referencesCALL relationalai.app.cleanup_unused_data_stream_references();