xiangfu0 commented on code in PR #18185:
URL: https://github.com/apache/pinot/pull/18185#discussion_r3294029308
##########
pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java:
##########
@@ -279,8 +301,49 @@ public String getSegmentMetadata(
Double indexSize = columnIndexSizes.getOrDefault(indexName, 0d)
+ value;
columnIndexSizes.put(indexName, indexSize);
columnIndexSizesMap.put(column, columnIndexSizes);
+
+ indexNames.add(indexName);
+ }
+
+ // Collect per-column compression stats when feature flag is
enabled
+ if (compressionStatsEnabled) {
+ String codec = columnMetadata.getCompressionCodec();
+ long uncompressedSize =
columnMetadata.getUncompressedForwardIndexSizeBytes();
+ long fwdIndexSize =
columnMetadata.getIndexSizeFor(StandardIndexes.forward());
+ if (codec != null && uncompressedSize > 0) {
+ // Raw column with stats: include in both numerator and
denominator
+ long[] accum = columnCompressionAccum.computeIfAbsent(column,
k -> new long[2]);
+ accum[0] += uncompressedSize;
+ accum[1] += (fwdIndexSize > 0 ? fwdIndexSize : 0);
+ columnCodecMap.merge(column, codec,
+ (existing, incoming) -> existing.equals(incoming) ?
existing : "MIXED");
+ // Raw columns never have a dictionary; once any segment is
raw, mark the column as no-dict
+ columnHasDictMap.merge(column, false, (existing, incoming) ->
false);
Review Comment:
Now we do support dictionary for a column, this assumption is not anymore
--
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]