<budget_name>!GET_MEASUREMENT_TABLE

View the credit usage data collected by the budget maintenance task. For more information, see Understand budget costs.

语法

<budget_name>!GET_MEASUREMENT_TABLE()

访问控制要求

  • 查看 自定义预算 的结果需要以下最低权限和角色:

  • 需要以下角色才能查看 账户预算 的结果:

    Any application role for the account budget.

For more information, see Budgets roles and privileges.

返回

该函数返回以下列:

Column NameData TypeDescription
MEASUREMENT_TIMENUMBERUTC timestamp when the measurement was taken.
SERVICE_TYPEVARCHAR

Type of service that is consuming credits, which can be one of the following:

  • AUTO_CLUSTERING
  • DATA_QUALITY_MONITORING
  • HYBRID_TABLE_REQUESTS
  • MATERIALIZED_VIEW
  • PIPE
  • QUERY_ACCELERATION
  • SEARCH_OPTIMIZATION
  • SERVERLESS_ALERTS
  • SERVERLESS_TASK
  • SNOWPIPE_STREAMING
  • WAREHOUSE_METERING
  • WAREHOUSE_METERING_READER
CREDITS_SPENTNUMBERNumber of credits spent.
UPDATED_TIMENUMBERUTC timestamp when the measurement was updated.

使用说明

Calling this method does not return the object. Because of this, you can’t use method chaining to call another method on the return value of this method. Instead, call each method in a separate SQL statement.

示例

View the credit usage data collected for budget my_budget in schema budget_db.budget_schema:

CALL budget_db.budget_schema.my_budget!GET_MEASUREMENT_TABLE();

查看为账户预算收集的 Credit 使用量数据:

CALL snowflake.local.account_root_budget!GET_MEASUREMENT_TABLE();