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 wrong origin returned by cagg_get_bucket_function_info #7533

Conversation

fabriziomello
Copy link
Contributor

@fabriziomello fabriziomello commented Dec 12, 2024

In #7042 we refactored the code for getting the time bucket function info to read information from the stored query tree on Postgres metadata.

But when an origin was not specified it was returning a wrong value instead of NULL. Fixed it by properly dealing with non-defined origin and also simplified a bit the code to process time bucket parameters.

Disable-check: force-changelog-file

@fabriziomello fabriziomello self-assigned this Dec 12, 2024
@fabriziomello fabriziomello changed the title Fix origin on cagg_get_bucket_function_info Fix wrong origin returned by cagg_get_bucket_function_info Dec 12, 2024
@fabriziomello fabriziomello force-pushed the fix_origin_on_cagg_get_bucket_function_info branch from 443d35b to 9270501 Compare December 12, 2024 22:46
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.19%. Comparing base (59f50f2) to head (172bc86).
Report is 655 commits behind head on main.

Files with missing lines Patch % Lines
tsl/src/continuous_aggs/common.c 88.23% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7533      +/-   ##
==========================================
+ Coverage   80.06%   82.19%   +2.12%     
==========================================
  Files         190      230      +40     
  Lines       37181    43280    +6099     
  Branches     9450    10882    +1432     
==========================================
+ Hits        29770    35574    +5804     
- Misses       2997     3390     +393     
+ Partials     4414     4316      -98     

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

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 in general, left a question about readability and setting the right expectations in the code.

tsl/src/continuous_aggs/common.c Show resolved Hide resolved
In timescale#7042 we refactored the code for getting the time bucket function
info to read information from the stored query tree on Postgres
metadata.

But when an origin was not specified it was returning a wrong value
instead of NULL. Fixed it by properly dealing with non-defined origin
and also simplified a bit the code to process time bucket parameters.
@fabriziomello fabriziomello force-pushed the fix_origin_on_cagg_get_bucket_function_info branch from 1b66597 to 172bc86 Compare December 16, 2024 13:51
Copy link
Contributor

@mkindahl mkindahl left a comment

Choose a reason for hiding this comment

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

There is some old odd choices regarding the time_bucket function implementation, but the changes here are good.

tsl/src/continuous_aggs/common.c Show resolved Hide resolved
@fabriziomello fabriziomello merged commit 9e40167 into timescale:main Dec 16, 2024
48 checks passed
@timescale-automation
Copy link

Automated backport to 2.17.x not done: cherry-pick failed.

Git status

HEAD detached at origin/2.17.x
You are currently cherry-picking commit 9e4016799.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   tsl/test/expected/cagg_migrate_function-14.out
	modified:   tsl/test/expected/cagg_migrate_function-15.out
	modified:   tsl/test/expected/cagg_migrate_function-16.out
	modified:   tsl/test/expected/cagg_migrate_function-17.out
	modified:   tsl/test/expected/cagg_query.out
	modified:   tsl/test/expected/cagg_query_using_merge.out
	modified:   tsl/test/expected/cagg_utils.out

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   tsl/src/continuous_aggs/common.c
	deleted by us:   tsl/test/expected/cagg_query-15.out
	deleted by us:   tsl/test/expected/cagg_query-16.out
	deleted by us:   tsl/test/expected/cagg_query-17.out
	deleted by us:   tsl/test/expected/cagg_query_using_merge-16.out
	deleted by us:   tsl/test/expected/cagg_query_using_merge-17.out
	both modified:   tsl/test/sql/CMakeLists.txt


Job log

@timescale-automation timescale-automation added the auto-backport-not-done Automated backport of this PR has failed non-retriably (e.g. conflicts) label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport-not-done Automated backport of this PR has failed non-retriably (e.g. conflicts) bug continuous_aggregate time_bucket
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants