mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 11:39:12 +00:00
Fix exact FQN matching for alert filter -filterByTableNameTestCaseBelongsTo (#17034)
This commit is contained in:
parent
924a100ab4
commit
0853e4b5b9
@ -255,7 +255,13 @@ public class AlertsRuleEvaluator {
|
||||
|
||||
EntityInterface entity = getEntity(changeEvent);
|
||||
for (String name : tableNameList) {
|
||||
Pattern pattern = Pattern.compile(name);
|
||||
// Escape regex special characters in table name for exact matching
|
||||
String escapedName = Pattern.quote(name);
|
||||
|
||||
// Construct regex to match table name exactly, allowing for end of string or delimiter (.)
|
||||
String regex = "\\b" + escapedName + "(\\b|\\.|$)";
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
|
||||
Matcher matcher = pattern.matcher(entity.getFullyQualifiedName());
|
||||
if (matcher.find()) {
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user