ONLINE_FEATURE_TABLE_REFRESH_HISTORY¶
This table function returns information about each refresh (completed and running) of online feature tables.
This table function returns all refreshes that are in progress as well as all refreshes that have a REFRESH_START_TIME within 7 days of the current time.
- See also:
CREATE ONLINE FEATURE TABLE , ALTER ONLINE FEATURE TABLE, DESCRIBE ONLINE FEATURE TABLE , DROP ONLINE FEATURE TABLE , SHOW ONLINE FEATURE TABLES
Syntax¶
ONLINE_FEATURE_TABLE_REFRESH_HISTORY(
[ REFRESH_START_TIMESTAMP => <constant_expr> ]
[ , REFRESH_END_TIMESTAMP => <constant_expr> ]
[ , RESULT_LIMIT => <integer> ]
[ , NAME => '<string>' ]
[ , NAME_PREFIX => '<string>' ]
[ , ERROR_ONLY => { TRUE | FALSE } ]
)
Arguments¶
All the arguments are optional. If no arguments are provided, 100 refreshes from all online feature tables in the account will be returned.
REFRESH_START_TIMESTAMP => constant_expr,REFRESH_END_TIMESTAMP => constant_exprTime range (in TIMESTAMP_LTZ format) during which the refreshes started. If an end version is not specified, CURRENT_TIMESTAMP is used as the end of the range.
RESULT_LIMIT => integerA number specifying the maximum number of rows returned by the function. If the number of matching rows is greater than this limit, the refreshes that finished most recently (and those that are still running) are returned, up to the specified limit.
Range: 1 to 10000
Default: 100.
NAME => 'string'The name of an online feature table.
You can specify the unqualified name (
online_feature_table_name), the partially qualified name (schema_name.online_feature_table_name), or the fully qualified name (database_name.schema_name.online_feature_table_name).For more information on object name resolution, see Object name resolution.
The function returns the refreshes for this table.
NAME_PREFIX => 'string'A prefix for online feature tables.
The function returns refreshes for tables with names that start with this prefix.
You can use this argument to return the refreshes for online feature tables in a specific database or schema.
ERROR_ONLY => { TRUE | FALSE }When set to TRUE, this function returns only refreshes that failed or were cancelled.
Default: FALSE
Output¶
The output of the command includes the following columns, which describe the properties and metadata of the object:
Column |
Data type |
Description |
|---|---|---|
|
TEXT |
Name of the online feature table. |
|
TEXT |
Name of the schema that contains the online feature table. |
|
TEXT |
Name of the database that contains the online feature table. |
|
TEXT |
Fully qualified name of the online feature table. |
|
TEXT |
Status of the refresh for the online feature table. The status can be one of the following:
|
|
TIMESTAMP_LTZ |
Time when the refresh job started. |
|
TIMESTAMP_LTZ |
Time when the refresh completed. |
|
TEXT |
One of:
|
|
TEXT |
One of:
|
|
TEXT |
ID of the SQL statement that produced the results for the online feature table. |
|
TEXT |
Code representing the current state of the refresh. |
|
TEXT |
Description of the current state of the refresh. |
Access control requirements¶
Privilege |
Object |
Notes |
|---|---|---|
MONITOR |
Online feature table |
Role that has the MONITOR privilege on the online feature table. |
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Usage notes¶
This function is available in the INFORMATION_SCHEMA.
The information returned by this function is up to date. Online Feature Table refresh history in the ACCOUNT_USAGE.ONLINE_FEATURE_TABLE_REFRESH_HISTORY view may lag by up to 3 hours.
Examples¶
The following example returns the refresh history for all online feature tables in the account:
SELECT *
FROM TABLE(INFORMATION_SCHEMA.ONLINE_FEATURE_TABLE_REFRESH_HISTORY());
The following example returns the refresh history for a specific online feature table named my_feature_table:
SELECT *
FROM TABLE(INFORMATION_SCHEMA.ONLINE_FEATURE_TABLE_REFRESH_HISTORY(
NAME => 'my_feature_table'
));
The following example returns only failed refreshes from the last 24 hours:
SELECT *
FROM TABLE(INFORMATION_SCHEMA.ONLINE_FEATURE_TABLE_REFRESH_HISTORY(
REFRESH_START_TIMESTAMP => CURRENT_TIMESTAMP - INTERVAL '1 DAY',
ERROR_ONLY => TRUE
));
The following example returns refreshes for online feature tables with names starting with feature_ and limits the results to 50 rows:
SELECT *
FROM TABLE(INFORMATION_SCHEMA.ONLINE_FEATURE_TABLE_REFRESH_HISTORY(
NAME_PREFIX => 'feature_',
RESULT_LIMIT => 50
));