LakshSingla commented on code in PR #13706:
URL: https://github.com/apache/druid/pull/13706#discussion_r1116545885
##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestTaskActionClient.java:
##########
@@ -94,13 +106,32 @@ public <RetType> RetType submit(TaskAction<RetType>
taskAction)
0
));
} else if (taskAction instanceof RetrieveUsedSegmentsAction) {
- return (RetType) ImmutableSet.of();
+ String dataSource = ((RetrieveUsedSegmentsAction)
taskAction).getDataSource();
+ if (!usedIntervals.containsKey(dataSource)) {
+ return (RetType) ImmutableSet.of();
+ } else {
+ return (RetType) usedIntervals.get(dataSource)
+ .stream()
+ .map(interval -> DataSegment.builder()
+
.dataSource(dataSource)
+
.interval(interval)
+
.version(VERSION)
+ .size(1)
+ .build()
+ ).collect(Collectors.toSet());
+ }
} else if (taskAction instanceof SegmentTransactionalInsertAction) {
// Always OK.
final Set<DataSegment> segments = ((SegmentTransactionalInsertAction)
taskAction).getSegments();
+ publishedSegments.addAll(segments);
return (RetType) SegmentPublishResult.ok(segments);
} else {
return null;
}
}
+
+ public Set<DataSegment> getPublishedSegments()
Review Comment:
`MSQTestSegmentManager` cannot be used because we are publishing the
segments from the Controller where we also compute and publish the tombstone
segments, but we are generating the segments in the
`SegmentGeneratorFrameProcessor` that takes the `MSQTestSegmentManager`. Since
tombstones are not generated (they don't contain any data), we cannot fetch the
segments (as there are none). We have to get it from the published segments.
Regarding maintaining the state in the MSQTestBase, I thought it was cleaner
that we do it directly because the CalciteSelectQueryTests also use this class
for MSQ, which won't utilize the published segments (so it would need to
provide an extra dummy argument)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]