Skip to content

Commit 0316e85

Browse files
fix: add backwards compatibility to internal filter (#107)
1 parent 8baa62e commit 0316e85

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

attribute-service-impl/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,13 @@ private Query getQueryForFilter(
388388
}
389389

390390
if (attributeMetadataFilter.hasInternal()) {
391-
andFilters.add(
392-
new Filter(Op.EQ, ATTRIBUTE_INTERNAL_KEY, attributeMetadataFilter.getInternal()));
391+
Filter internalFilter =
392+
new Filter(Op.EQ, ATTRIBUTE_INTERNAL_KEY, attributeMetadataFilter.getInternal());
393+
if (!attributeMetadataFilter.getInternal()) {
394+
// For backwards compatibility, treat an attribute missing internal attribute as external
395+
internalFilter = internalFilter.or(new Filter(Op.NOT_EXISTS, ATTRIBUTE_INTERNAL_KEY, null));
396+
}
397+
andFilters.add(internalFilter);
393398
}
394399

395400
Filter queryFilter = new Filter();

0 commit comments

Comments
 (0)