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

Support ALTER COLUMN SET NOT NULL on compressed chunks #7707

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

svenklemm
Copy link
Member

@svenklemm svenklemm commented Feb 13, 2025

This patch adds support for ALTER TABLE ALTER COLUMN SET NOT NULL
to compressed chunks. The statement will be allowed when no NULL
values for the specific column are present in compressed chunks.

@svenklemm svenklemm force-pushed the alter_set_not_null branch 2 times, most recently from 6c54f8c to c8f79c7 Compare February 13, 2025 13:43
Copy link
Contributor

@antekresic antekresic left a comment

Choose a reason for hiding this comment

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

Looks good, I'd add a test case for segmentby column altering as well.


initStringInfo(&command);
appendStringInfo(&command,
"SELECT EXISTS(SELECT FROM %s.%s WHERE %s IS NULL",
Copy link
Member

Choose a reason for hiding this comment

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

When the compressed column has a null value, it means a default, so probably shouldn't be an OR.

Copy link
Member

Choose a reason for hiding this comment

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

we also just found out it's not true, and we can't distinguish missing from default on the sql level..

This patch adds support for ALTER TABLE ALTER COLUMN SET NOT NULL
to compressed chunks. The statement will be allowed when no NULL
values for the specific column are present in compressed chunks.
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 71.18644% with 17 lines in your changes missing coverage. Please review.

Project coverage is 81.95%. Comparing base (59f50f2) to head (f7bc2fe).
Report is 764 commits behind head on main.

Files with missing lines Patch % Lines
src/process_utility.c 76.92% 3 Missing and 6 partials ⚠️
tsl/src/compression/compression.c 57.89% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7707      +/-   ##
==========================================
+ Coverage   80.06%   81.95%   +1.88%     
==========================================
  Files         190      246      +56     
  Lines       37181    45116    +7935     
  Branches     9450    11254    +1804     
==========================================
+ Hits        29770    36976    +7206     
- Misses       2997     3726     +729     
  Partials     4414     4414              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@svenklemm svenklemm merged commit 9382a90 into timescale:main Feb 14, 2025
47 of 48 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.

3 participants