Skip to content

fix: check active materialization before routing to pre-aggregate#21811

Open
IrakliJani wants to merge 1 commit intomainfrom
fix-wrongful-pre-aggregate-audit-hit
Open

fix: check active materialization before routing to pre-aggregate#21811
IrakliJani wants to merge 1 commit intomainfrom
fix-wrongful-pre-aggregate-audit-hit

Conversation

@IrakliJani
Copy link
Copy Markdown
Contributor

@IrakliJani IrakliJani commented Apr 7, 2026

Description:

This PR adds validation to ensure pre-aggregate queries only execute when an active materialization exists. The changes include:

  • Added preAggregateModel dependency to the PreAggregateStrategy to check for active materializations
  • Modified getRoutingDecision to be async and validate active materializations before routing queries to pre-aggregates
  • Added a new miss reason NO_ACTIVE_MATERIALIZATION when a pre-aggregate exists but has no active materialization
  • Updated the routing decision logic to fall back to warehouse execution when no active materialization is found

This prevents queries from being routed to pre-aggregates that don't have valid materializations available, improving query reliability and error handling.

@IrakliJani IrakliJani marked this pull request as ready for review April 7, 2026 15:44
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

🧪 Test Selection

✅ Tests that will run

Test Description
Preview Environment Deploys a preview environment for testing
Frontend E2E Tests Runs Cypress app tests
Backend API Tests Runs Vitest API tests
CLI Tests Runs CLI integration and dbt version tests

⏭️ Tests skipped (no relevant file changes detected)

Test How to trigger manually
Timezone Tests Add test-timezone to PR description

Tip: Add test-all to your PR description to run all tests.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

Your preview environment pr-21811 has been deployed.

Preview environment endpoints are available at:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

Preview Environment

🌐 URL: https://lightdash-preview-pr-21811.lightdash.okteto.dev

📋 Logs: View in GCP Console

🔧 SSH: ./scripts/okteto-ssh.sh 21811

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.

2 participants