Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Only apply partition interval unit if partitioned_by is not set by the user explicitly #3636

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

izeigerman
Copy link
Member

@izeigerman izeigerman commented Jan 16, 2025

When using INCREMENTAL_BY_TIME_RANGE models, SQLMesh automatically adjusts the table's partitioning to match the model's interval unit.

It turns out the logic for this applies to any model that uses partitioning, even though the original intention seems to have been aimed solely at INCREMENTAL_BY_TIME_RANGE models. This leads to unexpected results and behaviors, especially when the user explicitly specifies a certain partitioning scheme, but gets a different one in the resulting table.

This fix ensures that the partitioning based on the interval unit only applies to INCREMENTAL_BY_TIME_RANGE models and only if partitioned_by wasn't provided by the user directly.

@izeigerman izeigerman requested a review from a team January 16, 2025 01:19
@izeigerman izeigerman merged commit 5da32f2 into main Jan 16, 2025
21 checks passed
@izeigerman izeigerman deleted the fix-partition-interval-unit-application branch January 16, 2025 04:55
izeigerman added a commit that referenced this pull request Jan 16, 2025
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