adarshsanjeev commented on code in PR #18076:
URL: https://github.com/apache/druid/pull/18076#discussion_r2131498064


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/DartTableInputSpecSlicer.java:
##########
@@ -228,27 +282,28 @@ static Set<DartQueryableSegment> 
findQueryableDataSegments(
    *
    * @throws IllegalStateException if any provided segments do not match the 
provided datasource
    */
-  static List<InputSlice> makeSegmentSlices(
+  private List<InputSlice> makeSegmentSlices(
       final String dataSource,
-      final List<List<DartQueryableSegment>> assignments
+      final List<DartServerAssignment> assignments
   )
   {
     final List<InputSlice> retVal = new ArrayList<>(assignments.size());
 
-    for (final List<DartQueryableSegment> assignment : assignments) {
+    for (final DartServerAssignment assignment : assignments) {
       if (assignment == null || assignment.isEmpty()) {
         retVal.add(NilInputSlice.INSTANCE);
       } else {
-        final List<RichSegmentDescriptor> descriptors = new ArrayList<>();
-        for (final DartQueryableSegment segment : assignment) {
-          if (!dataSource.equals(segment.getSegment().getDataSource())) {
-            throw new ISE("Expected dataSource[%s] but got[%s]", dataSource, 
segment.getSegment().getDataSource());
-          }
-
-          descriptors.add(toRichSegmentDescriptor(segment));
-        }
-
-        retVal.add(new SegmentsInputSlice(dataSource, descriptors, 
ImmutableList.of()));
+        final List<RichSegmentDescriptor> descriptors = 
assignment.getDartQueryableSegments()

Review Comment:
   Makes sense. I went through a few different iterations of the code here, so 
I forgot the original code by the end.



-- 
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]

Reply via email to