forked from llooker/snowflake-usage-block
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snowflake_usage_block.model.lkml
77 lines (64 loc) · 1.48 KB
/
snowflake_usage_block.model.lkml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
connection: "account_usage"
# include all the views
include: "*.view"
# include all the dashboards
include: "account_usage_dashboard.dashboard.lookml"
datagroup: snowflake_usage_block_default_datagroup {
# sql_trigger: SELECT MAX(id) FROM etl_log;;
max_cache_age: "1 hour"
}
named_value_format: conditional_to_millions {
value_format: "[>=1000000]0,,\"M\";[>=1000]0,\"K\";0"
}
persist_with: snowflake_usage_block_default_datagroup
explore: login_history {
}
explore: query_history {
join: databases {
type: left_outer
sql_on: ${query_history.database_name} = ${databases.database_name} ;;
relationship: many_to_one
}
# join: schemata {
# type: left_outer
# sql_on: ${databases.id} = ${schemata.id} ;;
# relationship: one_to_many
# }
}
# explore: schemata {
# join: databases {
# type: left_outer
# sql_on: ${schemata.database_id} = ${databases.id} ;;
# relationship: many_to_one
# }
# }
explore: load_history {
fields: [ALL_FIELDS*,-tables.table_name,-tables.id]
join: tables {
sql_on: ${load_history.table_id} = ${tables.id} ;;
relationship: many_to_one
}
}
explore: storage_usage {}
explore: warehouse_metering_history {}
# explore: columns {}
#
# explore: databases {}
#
# explore: file_formats {}
#
# explore: functions {}
#
# explore: referential_constraints {}
#
# explore: sequences {}
#
# explore: stages {}
#
# explore: table_constraints {}
#
# explore: table_storage_metrics {}
#
# explore: tables {}
#
# explore: views {}