dclim commented on a change in pull request #6451: Fix inconsistent segment
size(#6448)
URL: https://github.com/apache/incubator-druid/pull/6451#discussion_r224675640
##########
File path:
sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java
##########
@@ -211,14 +210,64 @@ public TableType getJdbcTableType()
final Iterator<Entry<DataSegment, SegmentMetadataHolder>>
availableSegmentEntries = availableSegmentMetadata.entrySet()
.iterator();
+ // in memory map to store segment data from available segments
+ final Map<String, PartialSegmentData> partialSegmentDataMap = new
HashMap<>();
Review comment:
Again, minor, same end result, a bit more concise:
```
final Map<String, PartialSegmentData> partialSegmentDataMap =
availableSegmentMetadata.values().stream().collect(
Collectors.toMap(
SegmentMetadataHolder::getSegmentId,
x -> new PartialSegmentData(x.isAvailable(), x.isRealtime(),
x.getNumReplicas(), x.getNumRows())
));
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]