You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/11/07 18:28:55 UTC

[GitHub] [pinot] GSharayu commented on a diff in pull request #9733: show table metadata info in aggregate index size form

GSharayu commented on code in PR #9733:
URL: https://github.com/apache/pinot/pull/9733#discussion_r1015758480


##########
pinot-common/src/main/java/org/apache/pinot/common/restlet/resources/TableMetadataInfo.java:
##########
@@ -42,20 +42,23 @@ public class TableMetadataInfo {
   private final Map<String, Double> _columnLengthMap;
   private final Map<String, Double> _columnCardinalityMap;
   private final Map<String, Double> _maxNumMultiValuesMap;
+  private final Map<String, Map<String, Double>> _columnIndexSizeMap;
 
   @JsonCreator
   public TableMetadataInfo(@JsonProperty("tableName") String tableName,
       @JsonProperty("diskSizeInBytes") long sizeInBytes, @JsonProperty("numSegments") long numSegments,
       @JsonProperty("numRows") long numRows, @JsonProperty("columnLengthMap") Map<String, Double> columnLengthMap,
       @JsonProperty("columnCardinalityMap") Map<String, Double> columnCardinalityMap,
-      @JsonProperty("maxNumMultiValuesMap") Map<String, Double> maxNumMultiValuesMap) {
+      @JsonProperty("maxNumMultiValuesMap") Map<String, Double> maxNumMultiValuesMap,
+      @JsonProperty("columnIndexSizeMap") Map<String, Map<String, Double>> columnIndexSizeMap) {

Review Comment:
   Can we make this Nullable property?



##########
pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java:
##########
@@ -256,6 +258,13 @@ public String getSegmentMetadata(
               int maxNumMultiValues = columnMetadata.getMaxNumberOfMultiValues();
               maxNumMultiValuesMap.merge(column, (double) maxNumMultiValues, Double::sum);
             }
+            for (Map.Entry<ColumnIndexType, Long> entry : columnMetadata.getIndexSizeMap().entrySet()) {
+              Map<String, Double> columnIndexSizes = columnIndexSizesMap.getOrDefault(column, new HashMap<>());
+              Double indexSize = columnIndexSizes.getOrDefault(entry.getKey().getIndexName(), 0d);
+              indexSize += entry.getValue();
+              columnIndexSizes.put(entry.getKey().getIndexName(), indexSize);

Review Comment:
   nit: we can extract the index name once



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org