[Bug] Fix show load like match#6314
Conversation
|
This is a historical issue, because the previous |
e011d3e to
c1eb9a2
Compare
|
For historical tasks, the |
| if (entry.getKey().contains(stmt.getLabel())) { | ||
| String label = stmt.getLabel(); | ||
| // Compatible with historical issues | ||
| if (!label.contains("%")) { |
There was a problem hiding this comment.
This should be done in analyze() of CancelLoadStmt.
| } else if (ddlStmt instanceof CancelLoadStmt) { | ||
| boolean isAccurateMatch = ((CancelLoadStmt) ddlStmt).isAccurateMatch(); | ||
| String label = ((CancelLoadStmt) ddlStmt).getLabel(); | ||
| if (!isAccurateMatch && label != null) { |
There was a problem hiding this comment.
This should be done in analyze() of CancelLoadStmt.
| boolean isAccurateMatch = showStmt.isAccurateMatch(); | ||
| String label = showStmt.getLabelValue(); | ||
| if (!isAccurateMatch && label != null) { | ||
| if (!label.contains("%")) { |
There was a problem hiding this comment.
This should be done in analyze() of ShowLoadStmt.
| } else { | ||
| for (Map.Entry<String, List<LoadJob>> entry : labelToLoadJobs.entrySet()) { | ||
| if (entry.getKey().contains(labelValue)) { | ||
| PatternMatcher matcher = PatternMatcher.createMysqlPattern(labelValue, CaseSensibility.LABEL.getCaseSensibility()); |
There was a problem hiding this comment.
PatternMatcher.createMysqlPattern can be put outside the for loop.
Same suggestion to other PatternMatcher.createMysqlPattern.
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
Proposed changes
Matching should use patterns instead of contains
Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...