Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

homework #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

параметры сервисов в яндекс облаке могут меняться, это нормально

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
17 changes: 16 additions & 1 deletion models/marts/f_orders_stats.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,19 @@
)
}}

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('stg_orders') }} AS o
INNER JOIN {{ ref('stg_customer') }} AS c ON c.C_CUSTKEY = o.O_CUSTKEY
INNER JOIN {{ ref('stg_lineitem') }} AS l ON o.O_ORDERKEY = l.L_ORDERKEY
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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по-хорошему этот файлик бы в .gitignore :)

- package: dbt-labs/dbt_utils
version: 1.0.0
sha1_hash: 9d40854984b016025f5bdf200022d1afb9d6e0ac
Loading