Skip to content

Commit

Permalink
updates to fix schema evolution/unneeded fact table
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett Guenther committed Oct 3, 2018
1 parent 6b88753 commit 2847ef5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 84 deletions.
2 changes: 1 addition & 1 deletion databases.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ view: databases {
dimension: id {
primary_key: yes
type: number
sql: ${TABLE}.ID ;;
sql: ${TABLE}.DATABASE_ID ;;
}

dimension: comment {
Expand Down
14 changes: 3 additions & 11 deletions snowflake_usage_block.model.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ connection: "account_usage"
include: "*.view"

# include all the dashboards
include: "*.dashboard"
include: "account_usage_dashboard.dashboard.lookml"

datagroup: snowflake_usage_block_default_datagroup {
# sql_trigger: SELECT MAX(id) FROM etl_log;;
Expand All @@ -18,12 +18,6 @@ named_value_format: conditional_to_millions {
persist_with: snowflake_usage_block_default_datagroup

explore: login_history {
# join: user_login_facts {
# view_label: "Login History"
# type: left_outer
# sql_on: ${user_login_facts.login_name} = ${login_history.user_name} ;;
# relationship: many_to_many
# }
}

explore: query_history {
Expand Down Expand Up @@ -56,10 +50,10 @@ explore: load_history {
}
}

explore: user_login_facts {}

explore: storage_usage {}

explore: warehouse_metering_history {}

# explore: columns {}
#
# explore: databases {}
Expand All @@ -81,5 +75,3 @@ explore: storage_usage {}
# explore: tables {}
#
# explore: views {}

explore: warehouse_metering_history {}
19 changes: 2 additions & 17 deletions storage_usage.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ view: storage_usage {
SNOWFLAKE.ACCOUNT_USAGE.STORAGE_USAGE
{% endif %};;


dimension: database_id {
type: number
sql: ${TABLE}.DATABASE_ID ;;
Expand All @@ -33,16 +32,6 @@ view: storage_usage {
alias: [read]
}

dimension: stage_bytes {
type: number
sql: ${TABLE}.STAGE_BYTES ;;
}

dimension: stage_tb {
type: number
sql: ${stage_bytes} / power(1024,4) ;;
}

dimension: storage_bytes {
type: number
sql: {% if database_name._in_query or database_id._in_query %}
Expand Down Expand Up @@ -73,11 +62,7 @@ view: storage_usage {
}

dimension: total_tb {
sql: {% if database_name._in_query or database_id._in_query %}
${storage_tb} + ${failsafe_tb}
{% else %}
${stage_tb} + ${storage_tb} + ${failsafe_tb}
{% endif %};;
sql: ${storage_tb} + ${failsafe_tb};;
}

measure: count {
Expand All @@ -99,7 +84,7 @@ view: storage_usage {

measure: prior_mtd_billable_tb {
type: average
sql: ${stage_tb} + ${storage_tb} + ${failsafe_tb};;
sql: ${storage_tb} + ${failsafe_tb};;
filters: {field: usage_date value: "last month"}
value_format_name: decimal_4
}
Expand Down
55 changes: 0 additions & 55 deletions user_login_facts.view.lkml

This file was deleted.

0 comments on commit 2847ef5

Please sign in to comment.