cecemei commented on code in PR #17943:
URL: https://github.com/apache/druid/pull/17943#discussion_r2060748650


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/DartDataSegmentProvider.java:
##########
@@ -95,7 +96,10 @@ public Supplier<ResourceHolder<CompleteSegment>> 
fetchSegment(
         final PhysicalSegmentInspector inspector = 
segment.as(PhysicalSegmentInspector.class);
         channelCounters.addFile(inspector != null ? inspector.getNumRows() : 
0, 0);
       });
-      return new ReferenceCountingResourceHolder<>(new CompleteSegment(null, 
segment), closer);
+      return new ReferenceCountingResourceHolder<>(new CompleteSegment(
+          null,
+          Objects.requireNonNull(segment.getBaseSegment())
+      ), closer);

Review Comment:
   Some thoughts: it might be nice to introduce a `BaseSegment` and make 
`LookupSegment`, `QueryableIndexSegment` extends that, also restricts 
`ReferenceCountingSegment` and `CompleteSegment` wrap with that. And it might 
be nice for `ReferenceCountingSegment.acquireReferences` to return a closable 
segment that would close up the reference, so the code doesn't have to deal 
with the closer logic.  



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