Skip to content

Fix retry bug in tree model query which ignore the time filter#18179

Open
JackieTien97 wants to merge 3 commits into
masterfrom
fix-retry-bug
Open

Fix retry bug in tree model query which ignore the time filter#18179
JackieTien97 wants to merge 3 commits into
masterfrom
fix-retry-bug

Conversation

@JackieTien97

Copy link
Copy Markdown
Contributor

This pull request improves the handling of the WHERE condition in query statements to better support retries during query analysis. The main changes ensure that the original WHERE condition is preserved and can be restored if needed, preventing issues caused by modifications during query processing.

The most important changes are:

Enhancements for Query Retry Handling:

  • Added an originalWhereCondition field to the QueryStatement class, along with getter and setter methods, to store the initial WHERE condition for potential restoration. [1] [2]
  • Implemented the setWhereConditionBackToOriginal() method in QueryStatement to allow resetting the WHERE condition to its original state.
  • Updated the visitQuery method in AnalyzeVisitor to reset the WHERE condition to its original value at the start of analysis, ensuring retries work as expected.

Preservation of Original WHERE Condition:

  • Modified the analyzeGlobalTimeFilter method in AnalyzeVisitor to create and store a copy of the original WHERE condition before extracting the time predicate, and to set this copy in the QueryStatement. [1] [2]

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.50139% with 70 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.26%. Comparing base (c716365) to head (03604b2).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
.../db/queryengine/plan/execution/QueryExecution.java 61.29% 12 Missing ⚠️
...gine/plan/analyze/TreeAnalysisMutationJournal.java 89.90% 11 Missing ⚠️
...gine/plan/analyze/TemplatedAggregationAnalyze.java 64.00% 9 Missing ⚠️
...ression/visitor/predicate/PredicateSimplifier.java 70.96% 9 Missing ⚠️
...db/db/queryengine/plan/analyze/PredicateUtils.java 85.45% 8 Missing ⚠️
.../db/queryengine/plan/planner/TreeModelPlanner.java 0.00% 8 Missing ⚠️
...db/db/queryengine/plan/analyze/AnalyzeVisitor.java 82.85% 6 Missing ⚠️
...he/iotdb/db/queryengine/plan/planner/IPlanner.java 0.00% 3 Missing ⚠️
.../db/queryengine/plan/analyze/TemplatedAnalyze.java 0.00% 2 Missing ⚠️
...ne/plan/relational/analyzer/StatementAnalyzer.java 80.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18179      +/-   ##
============================================
+ Coverage     42.04%   42.26%   +0.22%     
  Complexity      318      318              
============================================
  Files          5312     5314       +2     
  Lines        375102   375580     +478     
  Branches      48422    48500      +78     
============================================
+ Hits         157693   158735    +1042     
+ Misses       217409   216845     -564     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant