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

Домашнее задание Гликин Сергей #64

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
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') }} flf -- PLEASE USE dbt's ref('') to ensure valid DAG execution!
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
6 changes: 3 additions & 3 deletions profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ clickhouse_starschema:
dev:
type: clickhouse
schema: default
host: "{{ env_var('DBT_HOST') }}"
host: "rc1b-r9pndkgp5n894crp.mdb.yandexcloud.net"
port: 8443
user: "{{ env_var('DBT_USER') }}"
password: "{{ env_var('DBT_PASSWORD') }}"
user: "admin"

Choose a reason for hiding this comment

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

логины-пароли лучше не коммитить в общий доступ

password: "clickhouse"
secure: True
verify: False
ci:
Expand Down