kfaraz commented on code in PR #14639:
URL: https://github.com/apache/druid/pull/14639#discussion_r1271231229


##########
server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:
##########
@@ -1780,11 +1795,16 @@ public void deleteSegments(final Set<DataSegment> 
segments)
           public Void inTransaction(Handle handle, TransactionStatus 
transactionStatus)
           {
             int segmentSize = segments.size();
-            String dataSource = "";
+            String dataSource = 
segments.stream().findAny().map(DataSegment::getDataSource).orElse("?");

Review Comment:
   Yeah, better to just check `segments.isEmpty()` at the start of the 
`deleteSegments` and return if it is empty. Then, we wouldn't need the 
`orElse()`.



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