planner: fix time range extraction when time column is on the right side#68826
Conversation
|
@panmuyun I've received your pull request and will start the review. I'll conduct a thorough review covering code quality, potential issues, and implementation details. ⏳ This process typically takes 10-30 minutes depending on the complexity of the changes. ℹ️ Learn more details on Pantheon AI. |
|
Hi @panmuyun. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hi @panmuyun. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
📝 WalkthroughWalkthroughThe PR fixes time range extraction for reversed predicates. ChangesTime range extraction with reversed predicate support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
[LGTM Timeline notifier]Timeline:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #68826 +/- ##
================================================
- Coverage 76.3104% 75.2449% -1.0656%
================================================
Files 2041 2026 -15
Lines 563452 570622 +7170
================================================
- Hits 429973 429364 -609
- Misses 132563 140988 +8425
+ Partials 916 270 -646
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/ok-to-test |
winoros
left a comment
There was a problem hiding this comment.
My deleted comment is not suitable.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: crazycs520, tangenta, winoros The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
1 similar comment
|
/retest |
|
@panmuyun: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #68770
Problem Summary:
extractTimeRangecould not extract correct time bounds when the target time column appeared on the right side of a comparison predicate, such as'2019-10-10 10:10:10' < update_time. In that case, the extractor reused the original comparison operator without adjusting for operand order, so the lower or upper bound was missed or interpreted in the wrong direction.This affects memtable predicate extraction paths that reuse
extractTimeRange, includingcluster_log,tidb_hot_regions_history, and metrics schema time filtering.What changed and how does it work?
This PR fixes operand-order handling in
extractTimeRange.extractColBinaryOpConsExprto return whether the extracted column is on the left side of the binary comparison.extractTimeRange, when the target column is on the right side, normalize the comparison direction before updating the extracted time range:<becomes><=becomes>=>becomes<>=becomes<=This PR also adds regression tests for reversed time comparisons in existing extractor test cases:
information_schema.cluster_loginformation_schema.tidb_hot_regions_historymetrics_schema.tidb_query_durationCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
Bug Fixes
column > constantandconstant < columnforms produce correct resultsTests