Skip to content

Commit

Permalink
Доработка кода
Browse files Browse the repository at this point in the history
  • Loading branch information
TatyanaMR committed Apr 25, 2024
1 parent e636052 commit 3e2b3e4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
6 changes: 0 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,15 @@ resource "yandex_mdb_clickhouse_cluster" "clickhouse_starschema" {
timezone = "UTC"
geobase_uri = ""
query_log_retention_size = 1073741824
query_log_retention_time = 2592000
query_thread_log_enabled = true
query_thread_log_retention_size = 536870912
query_thread_log_retention_time = 2592000
part_log_retention_size = 536870912
part_log_retention_time = 2592000
metric_log_enabled = true
metric_log_retention_size = 536870912
metric_log_retention_time = 2592000
trace_log_enabled = true
trace_log_retention_size = 536870912
trace_log_retention_time = 2592000
text_log_enabled = true
text_log_retention_size = 536870912
text_log_retention_time = 2592000
text_log_level = "TRACE"
background_pool_size = 16
background_schedule_pool_size = 16
Expand Down
14 changes: 13 additions & 1 deletion models/marts/f_orders_stats.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@
)
}}

SELECT 1
SELECT
toYear(O_ORDERDATE) AS O_ORDERYEAR,
O_ORDERSTATUS,
O_ORDERPRIORITY,
count(DISTINCT O_ORDERKEY) AS num_orders,
count(DISTINCT C_CUSTKEY) AS num_customers,
sum(L_EXTENDEDPRICE * L_DISCOUNT) AS revenue
FROM {{ ref('f_lineorder_flat') }}
WHERE 1=1
GROUP BY
toYear(O_ORDERDATE),
O_ORDERSTATUS,
O_ORDERPRIORITY
4 changes: 4 additions & 0 deletions package-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages:
- package: dbt-labs/dbt_utils
version: 1.0.0
sha1_hash: f4c10e8eb3db97171ea98d4851377e010cce1478

0 comments on commit 3e2b3e4

Please sign in to comment.