PIPE_USAGE_HISTORY

functionsupportedData loading & unloading

docs.snowflake.com ↗

Information SchemaTable functions

This table function can be used to query the history of data loaded into Snowflake tables using Snowpipe within a specified date range. The function returns the history of data loaded and credits billed for your entire Snowflake account. Note This function returns pipe activity within the last 14 days. Note This function is generally deprecated in favor of the ACCOUNT_USAGE.PIPE_USAGE_HISTORY view, which provides a more complete data set and supports longer date ranges.

Syntax

supportedpartialnot supportednot scored

PIPE_USAGE_HISTORY(
      [ DATE_RANGE_START => <constant_expr> ]
      [, DATE_RANGE_END => <constant_expr> ]
      [, PIPE_NAME => '<string>' ] )

Parameters

NameRequiredDescription
DATE_RANGE_START => constant_expr , DATE_RANGE_END => constant_exprrequiredThe date/time range, within the last 2 weeks, for which to retrieve the data load history: If an end date is not specified, then CURRENT_DATE is used as the end of the range. If a start date is not specified, then the range starts 10 minutes prior to the start of DATE_RANGE_END (i.e. the default is to show the previous 10 minutes of data load history). For example, if DATE_RANGE_END is CURRENT_DATE, then the default DATE_RANGE_START is 11:50 PM on the previous day. History is displayed in increments of 5 minutes, 1 hour, or 24 hours (depending on the length of the specified range). If the range falls outside the last 15 days, an error is returned.
PIPE_NAME => stringrequiredA string specifying a pipe. Only data loads that use the specified pipe are returned. If a pipe name is not specified, then the PIPE_NAME column in the results displays NULL. Each row includes the totals for all pipes in use within the time range.

Usage notes

Output

The function returns the following columns: Column Name | Data Type | Description START_TIME | TIMESTAMP_LTZ | Start of the specified time range in which data loads took place. END_TIME | TIMESTAMP_LTZ | End of the specified time range in which data loads took place. PIPE_NAME | TEXT | Name of the pipe used for a data load. Displays NULL if no pipe name is specified in the query. Each row includes the totals for all pipes in use within the time range. CREDITS_USED | TEXT | Number of credits billed for Snowpipe data loads during the START_TIME and END_TIME window. BYTES_INSERTED | NUMBER | Number of bytes loaded during the START_TIME and END_TIME window. FILES_INSERTED | NUMBER | Number of files loaded during the START_TIME and END_TIME window. BYTES_BILLED | NUMBER | Represents the number of bytes Snowpipe uses for billing purposes, providing visibility into Snowpipe’s cost implications directly within these history views.