-
Notifications
You must be signed in to change notification settings - Fork 885
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
Fix accessor function cagg_get_bucket_function #6922
Conversation
f71ad65
to
4d5e58f
Compare
Codecov ReportAttention: Patch coverage is
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. |
4d5e58f
to
a61f99f
Compare
b4c8a66
to
92a6e19
Compare
There was a problem hiding this 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.
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`.
92a6e19
to
38e5c2b
Compare
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 differenttime_bucket
function definition but what matters is the correct and validtime_bucket
function that is part of theQuery->groupClause
.Fixed it by inspecting only the
Query->groupClause
items looking for a valid time bucketFuncExpr
and return itOid
.Disable-check: force-changelog-file