Skip to content

Fix default dialect selection: prefer Druid for cubes, Trino otherwise#1919

Merged
shangyian merged 3 commits intoDataJunction:mainfrom
shangyian:fix-trino-default
Mar 25, 2026
Merged

Fix default dialect selection: prefer Druid for cubes, Trino otherwise#1919
shangyian merged 3 commits intoDataJunction:mainfrom
shangyian:fix-trino-default

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented Mar 25, 2026

Summary

/data/ and /sql/metrics/v3 were always generating Spark SQL when no dialect was specified, even on catalogs with a Trino engine, because resolve_dialect_and_engine_for_metrics picked engines[0] without preference and Spark happened to be first.

The fix applies the intended preference end-to-end: materialized cube = Druid engine; no cube = Trino engine (falling back to first engine if no Trino engine exists on the catalog). Explicit dialect=spark = Spark as before.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 25, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 90525a6
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69c3f58252f8b80008379cc3

@shangyian shangyian changed the title Default to Druid for materialized cubes, Trino for auto, and Spark if… Metrics SQL dialect: Default to Druid for materialized cubes, Trino for auto Mar 25, 2026
@shangyian shangyian changed the title Metrics SQL dialect: Default to Druid for materialized cubes, Trino for auto Fix default dialect selection: prefer Druid for cubes, Trino otherwise Mar 25, 2026
@shangyian shangyian marked this pull request as ready for review March 25, 2026 15:14
@shangyian shangyian merged commit c2868ef into DataJunction:main Mar 25, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant