jihoonson commented on a change in pull request #11457:
URL: https://github.com/apache/druid/pull/11457#discussion_r683889020



##########
File path: 
sql/src/main/java/org/apache/druid/sql/calcite/schema/DruidSchema.java
##########
@@ -494,14 +633,17 @@ void removeServerSegment(final DruidServerMetadata 
server, final DataSegment seg
 
   private long recomputeIsRealtime(ImmutableSet<DruidServerMetadata> servers)
   {
+    if (servers.isEmpty()) {
+      return 0;
+    }
     final Optional<DruidServerMetadata> historicalServer = servers
         .stream()
-        .filter(metadata -> metadata.getType().equals(ServerType.HISTORICAL))
+        .filter(metadata -> metadata.getType().equals(ServerType.HISTORICAL)
+                            || metadata.getType().equals(ServerType.BROKER))

Review comment:
       Yeah, I knew the current behavior but thought this could be better. But, 
on the second thought, probably better to keep the code logic consistent, so I 
reverted this change and added some comment.




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