Skip to content

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.

None.

An ARRAY of objects, one per removed reference, each with the following fields:

FieldTypeDescription
referenceNameSTRINGThe type of reference removed. One of DATA_STREAM_TABLE or DATA_STREAM_VIEW.
referenceAliasSTRINGThe internal alias of the removed reference.
fqObjectNameSTRINGThe fully qualified name of the Snowflake table or view the reference pointed to.
classificationSTRINGAlways UNUSED for references removed by this procedure.

Use app.reference_audit() to review unused references, then call app.cleanup_unused_data_stream_references() to remove them:

-- Review unused references first
CALL relationalai.app.reference_audit();
-- Remove all unused data stream references
CALL relationalai.app.cleanup_unused_data_stream_references();