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

Bolotyuk Dmitry #69

Open
wants to merge 3 commits 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
2 changes: 0 additions & 2 deletions .env.template

This file was deleted.

13 changes: 6 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "yandex_mdb_clickhouse_cluster" "clickhouse_starschema" {
sql_database_management = true
sql_user_management = true
admin_password = var.clickhouse_password
version = "23.3"
version = "23.8"

clickhouse {
resources {
Expand All @@ -39,21 +39,20 @@ 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
19 changes: 18 additions & 1 deletion models/marts/f_orders_stats.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,21 @@
)
}}

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_lineitem') }} AS l
INNER JOIN {{ ref('stg_orders') }} AS o ON o.O_ORDERKEY = l.L_ORDERKEY
INNER JOIN {{ ref('stg_customer') }} AS c ON c.C_CUSTKEY = o.O_CUSTKEY
INNER JOIN {{ ref('stg_supplier') }} AS s ON s.S_SUPPKEY = l.L_SUPPKEY
INNER JOIN {{ ref('stg_part') }} AS p ON p.P_PARTKEY = l.L_PARTKEY

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: f4c10e8eb3db97171ea98d4851377e010cce1478
8 changes: 1 addition & 7 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,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_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
Loading