Skip to content

Commit

Permalink
Merge pull request #3406 from ingef/fix/respect-filter-concepts
Browse files Browse the repository at this point in the history
remove events which dont satisfy filter concepts instead of assigning…
  • Loading branch information
awildturtok authored Apr 25, 2024
2 parents 70976c7 + 84268a2 commit 2505b41
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,30 +139,31 @@ else if (treeConcept.countElements() == 1) {


try {
// Events without values are assigned to the root
// Events can also be filtered, allowing a single table to be used by multiple connectors.
if (column != null && !bucket.has(event, column)) {
mostSpecificChildren[event] = treeConcept.getPrefix();
continue;
}

String stringValue = "";

if (column != null) {
final boolean has = column != null && bucket.has(event, column);

if (column != null && has) {
stringValue = bucket.getString(event, column);
}

// Events can also be filtered, allowing a single table to be used by multiple connectors.
// Lazy evaluation of map to avoid allocations if possible.
// Copy event for closure.
final int _event = event;
final CalculatedValue<Map<String, Object>> rowMap = new CalculatedValue<>(() -> bucket.calculateMap(_event));


if (connectorCondition != null && !connectorCondition.matches(stringValue, rowMap)) {
mostSpecificChildren[event] = Connector.NOT_CONTAINED;
continue;
}

// Events without values are assigned to the root
if (column != null && !has) {
mostSpecificChildren[event] = treeConcept.getPrefix();
continue;
}

final ConceptTreeChild child = cache == null
? treeConcept.findMostSpecificChild(stringValue, rowMap)
: cache.findMostSpecificChild(stringValue, rowMap);
Expand Down

0 comments on commit 2505b41

Please sign in to comment.