Skip to content

Commit

Permalink
fix: increase trino stage limit temporarily (#3118)
Browse files Browse the repository at this point in the history
* fix: increase trino `stage` limit temporarily

* fix: conditionally set `trino` config
  • Loading branch information
Jabolol authored Feb 27, 2025
1 parent c4730a1 commit 370ae01
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion warehouse/metrics_mesh/models/marts/metrics/metrics_v0.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
MODEL (
name metrics.metrics_v0,
kind FULL,
dialect trino,
tags (
'export'
)
);

@DEF(MAX_STAGE_OVERRIDE, 550);

-- TODO(jabolo): Remove Trino session logic once #3117 lands
@IF(
@OR(@gateway = 'trino', @gateway = 'local-trino'),
SET SESSION query_max_stage_count = @MAX_STAGE_OVERRIDE
);

WITH unioned_metric_names AS (
SELECT *
FROM metrics.int_metric_names_from_artifact
Expand Down Expand Up @@ -58,4 +67,10 @@ SELECT
raw_definition::TEXT,
definition_ref::TEXT,
aggregation_function::TEXT
FROM metrics_v0_no_casting
FROM metrics_v0_no_casting;

-- TODO(jabolo): Remove Trino session logic once #3117 lands
@IF(
@OR(@gateway = 'trino', @gateway = 'local-trino'),
RESET SESSION query_max_stage_count
);

0 comments on commit 370ae01

Please sign in to comment.