Skip to content

Commit 45ae555

Browse files
authored
fix | have distinct values in the id lookup table (#125)
* making the immutable table to have distinct value
1 parent 9da2a3f commit 45ae555

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

hypertrace-core-graphql-attribute-store/src/main/java/org/hypertrace/core/graphql/attributes/CachingAttributeStore.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
@Singleton
2020
class CachingAttributeStore implements AttributeStore {
21-
2221
private final CachingAttributeClient cachingAttributeClient;
2322
private final IdLookup idLookup;
2423
private final GrpcContextBuilder grpcContextBuilder;

hypertrace-core-graphql-attribute-store/src/main/java/org/hypertrace/core/graphql/attributes/IdLookup.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ private Single<ImmutableTable<String, String, String>> loadMappingsForContext(
6060
.flatMap(
6161
idMappingLoader ->
6262
idMappingLoader.loadMappings(key.getContext()).subscribeOn(this.boundedIoScheduler))
63+
// This is added to have distinct values while building the
64+
// immutable table in case of having duplicate id definitions
65+
.distinct()
6366
.collect(
6467
ImmutableTable.toImmutableTable(
6568
IdMapping::containingScope, IdMapping::foreignScope, IdMapping::idAttribute))

0 commit comments

Comments
 (0)