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


##########
parquet-cli/src/test/java/org/apache/parquet/cli/commands/FileTest.java:
##########
@@ -33,13 +33,13 @@
 
 public abstract class FileTest {
 
-  static final String INT32_FIELD = "int32_field";
-  static final String INT64_FIELD = "int64_field";
-  static final String FLOAT_FIELD = "float_field";
-  static final String DOUBLE_FIELD = "double_field";
-  static final String BINARY_FIELD = "binary_field";
-  static final String FIXED_LEN_BYTE_ARRAY_FIELD = "flba_field";
-  static final String DATE_FIELD = "date_field";
+  public static final String INT32_FIELD = "int32_field";
+  public static final String INT64_FIELD = "int64_field";
+  public static final String FLOAT_FIELD = "float_field";
+  public static final String DOUBLE_FIELD = "double_field";
+  public static final String BINARY_FIELD = "binary_field";
+  public static final String FIXED_LEN_BYTE_ARRAY_FIELD = "flba_field";
+  public static final String DATE_FIELD = "date_field";

Review Comment:
   At the end you haven't used these constants, have you?



##########
parquet-cli/src/test/java/org/apache/parquet/cli/ShowSizeStatisticsCliTest.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.parquet.cli;
+
+import java.io.File;
+import org.apache.parquet.cli.testing.CliTestBase;
+import org.junit.Test;
+
+public class ShowSizeStatisticsCliTest extends CliTestBase {
+
+  @Test
+  public void showSizeStatistics() throws Exception {
+    File file = parquetFile();
+
+    cli("size-stats " + file.getAbsolutePath())
+        .ok()
+        .matchOutputFromFile("src/test/resources/cli-outputs/size-stats.txt");
+  }
+
+  @Test
+  public void showsHelpMessage() throws Exception {
+    cli("help 
size-stats").ok().matchOutputFromFile("src/test/resources/cli-outputs/size-stats-help.txt");
+  }
+
+  @Test
+  public void showsSchemaOutput() throws Exception {
+    File file = parquetFile();
+    cli("schema " + file.getAbsolutePath())
+        .ok()
+        
.matchOutputFromFile("src/test/resources/cli-outputs/size-stats-column.txt");
+  }

Review Comment:
   I don't get why it is related to size statistics. Shouldn't it be put into a 
separate test for `schema`?



##########
parquet-cli/src/main/java/org/apache/parquet/cli/Main.java:
##########
@@ -82,7 +82,8 @@ public class Main extends Configured implements Tool {
   @VisibleForTesting
   final JCommander jc;
 
-  Main(Logger console) {
+  @VisibleForTesting
+  public Main(Logger console) {

Review Comment:
   nit: If you would create the cli harness fw into the same package, you 
wouldn't have to make it public. 



##########
parquet-cli/src/test/resources/cli-outputs/size-stats.txt:
##########
@@ -0,0 +1,10 @@
+Row group 0
+--------------------------------------------------------------------------------
+column         unencoded bytes rep level histogram                      def 
level histogram                     
+[int32_field]  -               -                                        -      
                                 

Review Comment:
   Shouldn't we choose a file that actually has size statistics for some 
columns?



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