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 accessor function cagg_get_bucket_function #6922

Merged

Conversation

fabriziomello
Copy link
Contributor

@fabriziomello fabriziomello commented May 15, 2024

In #6624 we refactored time_bucket catalog table to be more generic and introduced the cagg_get_bucket_function to inspect the query tree of a given Continuous Aggregate and return the time_bucket function oid.

The problem with the implementation is we traverse the whole query tree looking for FuncExpr and in certain cases we can have two different time_bucket function definition but what matters is the correct and valid time_bucket function that is part of the Query->groupClause.

Fixed it by inspecting only the Query->groupClause items looking for a valid time bucket FuncExpr and return it Oid.

Disable-check: force-changelog-file

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 68.75000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 80.87%. Comparing base (59f50f2) to head (92a6e19).
Report is 162 commits behind head on main.

Current head 92a6e19 differs from pull request most recent head 38e5c2b

Please upload reports for the commit 38e5c2b to get more accurate results.

Files Patch % Lines
tsl/src/continuous_aggs/repair.c 68.75% 1 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6922      +/-   ##
==========================================
+ Coverage   80.06%   80.87%   +0.80%     
==========================================
  Files         190      199       +9     
  Lines       37181    37190       +9     
  Branches     9450     9702     +252     
==========================================
+ Hits        29770    30078     +308     
- Misses       2997     3234     +237     
+ Partials     4414     3878     -536     

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

@fabriziomello fabriziomello force-pushed the fix_cagg_get_bucket_function branch 2 times, most recently from b4c8a66 to 92a6e19 Compare May 16, 2024 12:26
Copy link
Contributor

@erimatnor erimatnor left a comment

Choose a reason for hiding this comment

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

LGTM, just a few nits.

tsl/src/continuous_aggs/repair.c Outdated Show resolved Hide resolved
tsl/src/continuous_aggs/repair.c Outdated Show resolved Hide resolved
In timescale#6624 we refactored time_bucket catalog table to be more generic and
introduced the `cagg_get_bucket_function` to inspect the query tree of
a given Continuous Aggregate and return the time_bucket function oid.

The problem with the implementation is we traverse the whole query tree
looking for `FuncExpr` and in certain cases we can have two different
`time_bucket` function definition but what matters is the correct and
valid `time_bucket` function that is part of the `Query->groupClause`.

Fixed it by inspecting only the `Query->groupClause` items looking for
a valid time bucket `FuncExpr` and return it `Oid`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants