Skip to content

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

Open
JackieTien97 wants to merge 1 commit into
masterfrom
fix-retry-bug
Open

Fix retry bug in tree model query which ignore the time filter#18179
JackieTien97 wants to merge 1 commit 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

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

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