llooker/snowflake-usage-block

Storage Usage Explore, field "Stage Bytes"

ysmx-github opened this issue · 0 comments

This is the error:
SQL Syntax Error: SQL compilation error: error line 14 at position 1 invalid identifier 'STORAGE_USAGE.STAGE_BYTES'

If database_id or database_name is selected when it switches to DATABASE_STORAGE_USAGE_HISTORY table, something goes wrong with stage_bytes. All other similar fields in storage_usage_core have something like this:

sql: {% if database_name._in_query or database_id._in_query %}
${TABLE}.AVERAGE_FAILSAFE_BYTES
{% else %}
${TABLE}.FAILSAFE_BYTES
 {% endif %};;
description: "Number of bytes of data in Fail-safe"

but stage_bytes is simply:

dimension: stage_bytes {
type: number
sql: ${TABLE}.stage_bytes ;;
description: "Number of bytes of stage storage used by files in all internal stages (named, table, and user)"
}