FrankChen021 commented on code in PR #20541:
URL: https://github.com/apache/druid/pull/20541#discussion_r4229988527
##########
processing/src/main/java/org/apache/druid/segment/PartialQueryableIndexSegment.java:
##########
@@ -98,8 +96,16 @@ public <T> T as(@Nonnull Class<T> clazz)
return (T) index;
} else if (TimeBoundaryInspector.class.equals(clazz)) {
return (T) timeBoundaryInspector;
- } else if (RowCountInspector.class.equals(clazz)) {
- return (T) rowCountInspector;
+ } else if (RowCountInspector.class.equals(clazz)
+ || PhysicalSegmentColumnInspector.class.equals(clazz)
+ || PhysicalSegmentInspector.class.equals(clazz)) {
+ if (index.isFullyDownloaded()) {
+ // If fully downloaded, we can return some additional information.
+ return (T) new QueryableIndexPhysicalSegmentInspector(index);
Review Comment:
[P2] Use resident column capabilities for the full-download inspector
**Finding:** For a non-clustered V10 segment with a string dimension
configured with `createBitmapIndex=false`, this full-download branch still
reports `isDictionaryEncoded=false`:
`QueryableIndexPhysicalSegmentInspector.getColumnCapabilities` delegates to
`PartialQueryableIndex.getColumnCapabilities`, which always builds
descriptor-only capabilities. `SegmentAnalyzer` finds the resident column
holder, but its string-analysis path has no `DictionaryEncodedStringValueIndex`
without bitmaps and only falls back to the column dictionary when these
capabilities report dictionary encoding. Consequently a segment metadata query
requesting CARDINALITY or MINMAX returns cardinality 0 and null bounds for a
populated dimension even after every file has been downloaded. The added
analysis test uses a bitmap-indexed dimension, so it does not exercise this
path.
**Suggestion:** Have the fully downloaded inspector obtain non-clustered
column capabilities from the resident holders, and cover string metadata
analysis with bitmap indexes disabled.
--
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]