Skip to content

Fix: Match dbt handling of cluster_by config for view materializations#5266

Merged
crericha merged 2 commits intomainfrom
ignore-view-cluster-by
Sep 3, 2025
Merged

Fix: Match dbt handling of cluster_by config for view materializations#5266
crericha merged 2 commits intomainfrom
ignore-view-cluster-by

Conversation

@crericha
Copy link
Contributor

dbt disregards cluster_by config when creating tables for view models.

@crericha crericha requested a review from a team August 29, 2025 20:12
Comment on lines +470 to +471
if self.cluster_by:
if self.cluster_by and not isinstance(kind, ViewKind):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to push this further down into sqlmesh's model validator? I thought it wasn't possible to cluster normal views in general.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be pushed down into sqlmesh; however, will it match how sqlmesh wants to handle misconfiguration? I'm under the impression that sqlmesh wants to error, not ignore. wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that makes sense to me. Do we already throw an error today for this? (Just curious, fine if we don't for now.)

@georgesittas
Copy link
Contributor

Let's add a test for this.

@crericha crericha force-pushed the ignore-view-cluster-by branch from 64f6cba to bb7f3d0 Compare September 3, 2025 15:30
@crericha crericha merged commit d307981 into main Sep 3, 2025
36 checks passed
@crericha crericha deleted the ignore-view-cluster-by branch September 3, 2025 15:46
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