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

fix: write MVs to xapi schema again #39

Merged
merged 1 commit into from
Jan 12, 2024
Merged
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
3 changes: 3 additions & 0 deletions macros/get_custom_schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% macro generate_schema_name(custom_schema_name, node) -%}
{{ generate_schema_name_for_env(custom_schema_name, node) }}
{%- endmacro %}
2 changes: 1 addition & 1 deletion models/base/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2

sources:
- name: xapi
database: "{{ env_var('XAPI_SCHEMA', 'xapi') }}"
database: "{{ env_var('ASPECTS_XAPI_DATABASE', 'xapi') }}"
description: "the xapi database in clickhouse"
tables:
- name: xapi_events_all
Expand Down
1 change: 1 addition & 0 deletions models/base/xapi_events_all_parsed.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='materialized_view',
schema=env_var('ASPECTS_XAPI_DATABASE', 'xapi'),
engine=get_engine('ReplacingMergeTree()'),
primary_key='(org, course_id, verb_id, actor_id, emission_time, event_id)',
order_by='(org, course_id, verb_id, actor_id, emission_time, event_id)',
Expand Down
1 change: 1 addition & 0 deletions models/completion/completion_events.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='materialized_view',
schema=env_var('ASPECTS_XAPI_DATABASE', 'xapi'),
engine=get_engine('ReplacingMergeTree()'),
primary_key='(org, course_key, verb_id)',
order_by='(org, course_key, verb_id, emission_time, actor_id, object_id, event_id)'
Expand Down
1 change: 1 addition & 0 deletions models/enrollment/enrollment_events.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='materialized_view',
schema=env_var('ASPECTS_XAPI_DATABASE', 'xapi'),
engine=get_engine('ReplacingMergeTree()'),
primary_key='(org, course_key)',
order_by='(org, course_key, emission_time, actor_id, enrollment_mode, event_id)'
Expand Down
1 change: 1 addition & 0 deletions models/forum/forum_events.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='materialized_view',
schema=env_var('ASPECTS_XAPI_DATABASE', 'xapi'),
engine=get_engine('ReplacingMergeTree()'),
primary_key='(org, course_key, verb_id)',
order_by='(org, course_key, verb_id, emission_time, actor_id, object_id, event_id)'
Expand Down
1 change: 1 addition & 0 deletions models/grading/grading_events.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='materialized_view',
schema=env_var('ASPECTS_XAPI_DATABASE', 'xapi'),
engine=get_engine('ReplacingMergeTree()'),
primary_key='(org, course_key, verb_id)',
order_by='(org, course_key, verb_id, emission_time, actor_id, object_id, scaled_score, event_id)'
Expand Down
1 change: 1 addition & 0 deletions models/problems/problem_events.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='materialized_view',
schema=env_var('ASPECTS_XAPI_DATABASE', 'xapi'),
engine=get_engine('ReplacingMergeTree()'),
primary_key='(org, course_key, verb_id)',
order_by='(org, course_key, verb_id, emission_time, actor_id, object_id, responses, success, event_id)'
Expand Down
1 change: 1 addition & 0 deletions models/video/video_playback_events.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='materialized_view',
schema=env_var('ASPECTS_XAPI_DATABASE', 'xapi'),
engine=get_engine('ReplacingMergeTree()'),
primary_key='(org, course_key, verb_id)',
order_by='(org, course_key, verb_id, emission_time, actor_id, video_position, event_id)'
Expand Down
1 change: 1 addition & 0 deletions models/video/video_transcript_events.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='materialized_view',
schema=env_var('ASPECTS_XAPI_DATABASE', 'xapi'),
engine=get_engine('ReplacingMergeTree()'),
primary_key='(org, course_key, video_id)',
order_by='(org, course_key, video_id, emission_time, actor_id, cc_enabled, event_id)'
Expand Down
4 changes: 2 additions & 2 deletions sample_profiles.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
aspects: # this needs to match the profile in your dbt_project.yml file
target: dev
target: prod
outputs:
dev:
prod:
type: clickhouse
schema: xapi
host: localhost
Expand Down