gszadovszky commented on code in PR #3274:
URL: https://github.com/apache/parquet-java/pull/3274#discussion_r2302848724


##########
parquet-cli/src/main/java/org/apache/parquet/cli/commands/ShowSizeStatisticsCommand.java:
##########
@@ -60,9 +72,13 @@ public int run() throws IOException {
 
       console.info("\nFile path: {}", source);
 
-      List<BlockMetaData> rowGroups = footer.getBlocks();
-      for (int index = 0, n = rowGroups.size(); index < n; index++) {
-        printRowGroupSizeStats(console, index, rowGroups.get(index), schema);
+      List<BlockMetaData> blocks = footer.getBlocks();
+      Set<Integer> allowedRowGroups = rowGroups == null ? null : new 
HashSet<>(rowGroups);

Review Comment:
   nit: If you would create an empty Set instead of initializing with a null, 
you wouldn't have to check for null in the loop.



##########
parquet-cli/src/main/java/org/apache/parquet/cli/commands/ShowSizeStatisticsCommand.java:
##########
@@ -84,7 +100,16 @@ private void printRowGroupSizeStats(Logger console, int 
index, BlockMetaData row
     console.info(
         String.format(formatString, "column", "unencoded bytes", "rep level 
histogram", "def level histogram"));
 
+    Set<String> allowedColumns = null;
+    if (columns != null && !columns.isEmpty()) {
+      allowedColumns = new HashSet<>(columns);
+    }

Review Comment:
   See previous comment



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