Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Commit 9c43c6f

Browse files
committed
Merge branch 'main' into remove+get+aggregated+metrics
2 parents 0c4d602 + a0e5c44 commit 9c43c6f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

gateway-service-impl/src/main/java/org/hypertrace/gateway/service/entity/query/visitor/ExecutionVisitor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ public EntityResponse visit(SelectionNode selectionNode) {
300300
source -> {
301301
EntitiesRequest request =
302302
EntitiesRequest.newBuilder(executionContext.getEntitiesRequest())
303+
.clearSelection()
303304
.clearTimeAggregation()
304305
.clearFilter()
305306
.clearOrderBy()

gateway-service-impl/src/test/java/org/hypertrace/gateway/service/entity/query/visitor/ExecutionVisitorTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ public void test_visitPaginateOnlyNode() {
684684
when(executionContext.getTimestampAttributeId()).thenReturn("API.startTime");
685685
EntitiesRequest entitiesRequestForAttributes = EntitiesRequest.newBuilder(entitiesRequest)
686686
.clearSelection()
687+
.clearTimeAggregation()
687688
.addSelection(selectionExpression)
688689
.setLimit(limit + offset)
689690
.setOffset(0)
@@ -694,11 +695,13 @@ public void test_visitPaginateOnlyNode() {
694695
.clearOffset()
695696
.clearOrderBy()
696697
.clearSelection()
698+
.clearTimeAggregation()
697699
.addSelection(metricExpression)
698700
.clearFilter()
699701
.setFilter(generateInFilter(API_ID_ATTR, List.of("entity-id-3", "entity-id-2")))
700702
.build();
701703
EntitiesRequest entitiesRequestForTimeAggregation = EntitiesRequest.newBuilder(entitiesRequest)
704+
.clearSelection()
702705
.clearLimit()
703706
.clearOffset()
704707
.clearOrderBy()
@@ -753,10 +756,12 @@ public void test_visitSelectionNode_differentSource_callSeparatedCalls() {
753756
Map.of(EDS_SOURCE, Collections.emptyList()),
754757
Map.of(QS_SOURCE, Collections.emptyList()));
755758
when(entityDataServiceEntityFetcher.getEntities(any(), any())).thenReturn(result4);
759+
when(queryServiceEntityFetcher.getEntities(any(), any())).thenReturn(result4);
756760
when(executionVisitor.visit(any(NoOpNode.class)))
757761
.thenReturn(new EntityResponse(result4, result4.getEntityKeyBuilderMap().keySet()));
758762
executionVisitor.visit(selectionNode);
759-
verify(entityDataServiceEntityFetcher, times(2)).getEntities(any(), any());
763+
verify(entityDataServiceEntityFetcher).getEntities(any(), any());
764+
verify(queryServiceEntityFetcher).getEntities(any(), any());
760765
}
761766

762767
@Test

0 commit comments

Comments
 (0)