cloud_files_state table-valued function

Returns the file-level state of an autoloader cloud_files source.

Syntax

cloud_files_state( checkpoint )

Arguments

  • checkpoint: A STRING literal. The checkpoint directory used by a cloud_files source

Returns

Returns a table with the following schema:

  • path STRING NOT NULL PRIMARY KEY

    The path of a file.

  • size BIGINT NOT NULL

    The size of a file in bytes.

  • create_time TIMESTAMP NOT NULL

    The time that a file was created.

  • discovery_time TIMESTAMP NOT NULL

    The time that a file was discovered by CLOUD_FILES

  • commit_time TIMESTAMP

    The time that a file was committed to the checkpoint after processing. NULL if the file is not yet processed.

  • archive_time TIMESTAMP

    The time that a file was archived. NULL if the file has not been archived.

Examples

-– Simple example from checkpoint
> SELECT path FROM CLOUD_FILES_STATE('/some/checkpoint');
  /some/input/path
  /other/input/path

-– Simple example from source subdir
> SELECT path FROM CLOUD_FILES_STATE('/some/checkpoint/sources/0');
  /some/input/path
  /other/input/path