Skip to content

Commit 6c751ad

Browse files
author
Cristhian Garcia
authored
Merge pull request #685 from openedx/cag/clickhouse-24.3
feat: upgrade to clickhouse 24.3 LTS
2 parents 27aa42f + 2542a5a commit 6c751ad

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

tutoraspects/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
("RUN_RALPH", True),
3636
("RUN_SUPERSET", True),
3737
("DOCKER_IMAGE_ASPECTS", "edunext/aspects:{{ ASPECTS_VERSION }}"),
38-
("DOCKER_IMAGE_CLICKHOUSE", "clickhouse/clickhouse-server:23.8"),
38+
("DOCKER_IMAGE_CLICKHOUSE", "clickhouse/clickhouse-server:24.3"),
3939
("DOCKER_IMAGE_RALPH", "fundocker/ralph:4.1.0"),
4040
("DOCKER_IMAGE_SUPERSET", "edunext/aspects-superset:{{ ASPECTS_VERSION }}"),
4141
("DOCKER_IMAGE_VECTOR", "timberio/vector:0.30.0-alpine"),
@@ -376,7 +376,7 @@
376376
# For now we are pulling this from github, which should allow maximum
377377
# flexibility for forking, running branches, specific versions, etc.
378378
("DBT_REPOSITORY", "https://github.com/openedx/aspects-dbt"),
379-
("DBT_BRANCH", "v3.9.1"),
379+
("DBT_BRANCH", "v3.9.2"),
380380
("DBT_SSH_KEY", ""),
381381
("DBT_STATE_DIR", "/app/aspects/dbt_state/"),
382382
# This is a pip compliant list of Python packages to install to run dbt

tutoraspects/templates/aspects/jobs/init/clickhouse/init-clickhouse.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ GRANT {{ ON_CLUSTER }} SELECT ON system.disks TO '{{ ASPECTS_CLICKHOUSE_REPORT_U
6060
GRANT {{ ON_CLUSTER }} SELECT ON system.events TO '{{ ASPECTS_CLICKHOUSE_REPORT_USER }}';
6161
GRANT {{ ON_CLUSTER }} SELECT ON system.metrics TO '{{ ASPECTS_CLICKHOUSE_REPORT_USER }}';
6262
GRANT {{ ON_CLUSTER }} SELECT ON system.replication_queue TO '{{ ASPECTS_CLICKHOUSE_REPORT_USER }}';
63+
GRANT {{ ON_CLUSTER }} SELECT ON system.query_log TO '{{ ASPECTS_CLICKHOUSE_REPORT_USER }}';
6364
6465
-- Patch from clickhouse-extra-sql follows...
6566
{{ patch("clickhouse-extra-sql") }}

tutoraspects/templates/openedx-assets/queries/fact_enrollments.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
with enrollments as (
1+
with enrollments_base as (
22
select *
33
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_enrollments
44
where
@@ -15,4 +15,4 @@ select
1515
actor_id,
1616
enrollment_mode,
1717
enrollment_status
18-
from enrollments
18+
from enrollments_base

tutoraspects/templates/openedx-assets/queries/fact_learner_problem_summary.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ WITH problem_responses AS (
7070
attempts
7171
FROM problem_responses
7272
INNER JOIN final_responses USING (org, course_key, problem_id, actor_id, emission_time)
73-
), summary AS (
73+
), summary_base AS (
7474
SELECT
7575
org,
7676
course_key,
@@ -115,7 +115,7 @@ SELECT
115115
coalesce(any(attempts), 0) AS attempts,
116116
sum(num_hints_displayed) AS num_hints_displayed,
117117
sum(num_answers_displayed) AS num_answers_displayed
118-
FROM summary
118+
FROM summary_base
119119
where
120120
{% raw %}
121121
{% if get_filters('problem_name_with_location', remove_filter=True) == [] %}

tutoraspects/templates/openedx-assets/queries/fact_pageview_engagement.sql

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ with
33
select
44
org,
55
course_key,
6+
course_run,
67
section_with_name,
78
subsection_with_name,
89
actor_id,
910
page_count,
10-
countdistinct(block_id) as pages_visited,
11+
COUNT(DISTINCT block_id) as pages_visited,
1112
case
1213
when pages_visited = 0
1314
then 'No pages viewed yet'
@@ -30,6 +31,7 @@ with
3031
group by
3132
org,
3233
course_key,
34+
course_run,
3335
section_with_name,
3436
subsection_with_name,
3537
actor_id,
@@ -39,6 +41,7 @@ with
3941
select
4042
org,
4143
course_key,
44+
course_run,
4245
section_with_name,
4346
actor_id,
4447
sum(page_count) as page_count,
@@ -51,12 +54,13 @@ with
5154
else 'At least one page viewed'
5255
end as engagement_level
5356
from subsection_counts
54-
group by org, course_key, section_with_name, actor_id
57+
group by org, course_key, course_run, section_with_name, actor_id
5558
)
5659

5760
select
5861
org,
5962
course_key,
63+
course_run,
6064
subsection_with_name as `section/subsection name`,
6165
'subsection' as `content level`,
6266
actor_id as actor_id,
@@ -66,6 +70,7 @@ union all
6670
select
6771
org,
6872
course_key,
73+
course_run,
6974
section_with_name as `section/subsection name`,
7075
'section' as `content level`,
7176
actor_id as actor_id,

tutoraspects/templates/openedx-assets/queries/int_problem_responses.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
with problem_responses as (
1+
with problem_responses_base as (
22
select *
33
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_problem_responses
44
where 1=1
@@ -19,4 +19,4 @@ select
1919
success,
2020
responses
2121
from
22-
problem_responses
22+
problem_responses_base

0 commit comments

Comments
 (0)