Schema:

ACCOUNT_USAGE

ICEBERG_ORPHAN_FILE_CANDIDATES_HISTORY view

Use this Account Usage view to query the orphan file candidates that Snowflake detected for Snowflake-managed Apache Iceberg™ tables in your account within the last 365 days (1 year). Each row represents one orphan file candidate that was detected in one detection run, along with the latest action that Snowflake took on the file.

Note

This view contains data only if you enabled orphan file deletion for your account. For more information, see Orphan file deletion for Snowflake-managed Iceberg tables.

Columns

Column nameData typeDescription
EVENT_TIMESTAMPTIMESTAMP_LTZTime of the detection run that found the file. Matches EVENT_TIMESTAMP for the run in the ICEBERG_ORPHAN_FILE_DETECTION_HISTORY view view.
CLONE_GROUP_IDNUMBERIdentifier of the clone group that the file belongs to. A table and its clones share the same storage and the same clone group.
TABLE_NAMEVARCHARName of the table that is the source of the clone group.
SCHEMA_IDNUMBERInternal, system-generated identifier of the schema that contains the table.
SCHEMA_NAMEVARCHARName of the schema that contains the table.
DATABASE_IDNUMBERInternal, system-generated identifier of the database that contains the table.
DATABASE_NAMEVARCHARName of the database that contains the table.
FILE_PATHVARCHARFull cloud storage path of the orphan file.
FILE_SIZE_BYTESNUMBERSize of the file in bytes.
FILE_LAST_MODIFIED_TIMETIMESTAMP_LTZTime that the file was last modified in cloud storage.
LISTING_RUN_START_TIMETIMESTAMP_LTZStart time of the storage listing in which Snowflake observed the file.
STATUSVARCHAR

Latest action that Snowflake took on the file. Possible values:

  • REPORTED: Snowflake detected the file as an orphan file candidate and hasn’t taken any action yet.
  • TAGGED: Snowflake tagged the file. If the account action is DELETE, Snowflake deletes the file after the cooling period.
  • DELETION_SCHEDULED: The file’s cooling period has ended, and the file is ready for deletion. Snowflake deletes the file asynchronously.
  • SKIPPED: Snowflake won’t delete the file. See the MESSAGE column for the reason.
MESSAGEVARCHAR

Reason that Snowflake skipped the file. NULL unless STATUS is SKIPPED. Possible values:

  • FILE_REFERENCED: A table still references the file.
  • OFD_TAG_NOT_FOUND: The orphan file tag is no longer on the file. For example, another job in your storage removed the tag or overwrote the file.
  • FILE_NOT_FOUND: The file no longer exists in cloud storage.
  • TABLE_NOT_FOUND: The table that the file belonged to no longer exists, for example because it was dropped.
STATUS_TIMETIMESTAMP_LTZTime that the file reached its current status. NULL when STATUS is REPORTED.

Usage notes

  • STATUS, MESSAGE, and STATUS_TIME describe the latest action on the file, not the action in a specific run. If Snowflake detected the same file in more than one run, every row for the file shows the same values for these columns.
  • To see the detection run that found a file, join this view with the ICEBERG_ORPHAN_FILE_DETECTION_HISTORY view view on EVENT_TIMESTAMP.
  • The view contains data for the last 365 days.
  • The USAGE_VIEWER role is granted the SELECT privilege on this view. For more information, see SNOWFLAKE database roles.