the-other-tim-brown commented on code in PR #669:
URL: https://github.com/apache/incubator-xtable/pull/669#discussion_r2052654864


##########
xtable-core/src/test/java/org/apache/xtable/parquet/TestParquetStatsExtractor.java:
##########
@@ -0,0 +1,184 @@
+/*
+ * 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.xtable.parquet;
+
+
+import static org.apache.parquet.column.Encoding.BIT_PACKED;
+import static org.apache.parquet.column.Encoding.PLAIN;
+import static org.junit.jupiter.api.Assertions.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import lombok.Builder;
+
+import org.apache.hadoop.conf.Configuration;
+import java.nio.file.Paths;
+
+import java.nio.file.Files;
+//import java.nio.file.Path;
+import org.apache.hadoop.fs.Path;
+import org.apache.parquet.bytes.BytesInput;
+import org.apache.parquet.column.ColumnDescriptor;
+import org.apache.parquet.column.statistics.IntStatistics;
+import org.apache.parquet.column.statistics.BinaryStatistics;
+import org.apache.parquet.io.api.Binary;
+import org.apache.parquet.hadoop.ParquetFileReader;
+import org.apache.parquet.hadoop.ParquetFileWriter;
+import org.apache.parquet.hadoop.metadata.CompressionCodecName;
+import org.apache.parquet.schema.*;
+import org.apache.parquet.schema.MessageType;
+import org.apache.parquet.schema.MessageTypeParser;
+import org.apache.parquet.schema.PrimitiveType.PrimitiveTypeName;
+import org.apache.parquet.schema.Type.Repetition;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import org.apache.xtable.model.schema.InternalField;
+import org.apache.xtable.model.stat.ColumnStat;
+import org.apache.xtable.model.stat.Range;
+import org.apache.xtable.model.storage.FileFormat;
+import org.apache.xtable.model.storage.InternalDataFile;
+
+import org.junit.jupiter.api.io.TempDir;
+
+public class TestParquetStatsExtractor {
+    @TempDir
+    static java.nio.file.Path tempDir = Paths.get("./");
+
+    @Builder.Default
+    private static final ParquetSchemaExtractor schemaExtractor =
+            ParquetSchemaExtractor.getInstance();
+
+    public static List<ColumnStat> initFileTest(File file) throws IOException {
+        // create the parquet file by parsing a schema
+        Path path = new Path(file.toURI());
+        Configuration configuration = new Configuration();
+
+        MessageType schema =
+                //MessageTypeParser.parseMessageType("message m { required 
group a {required binary b;}}");

Review Comment:
   @unical1988 remember that we are volunteering our time here. This is not 
part of my day job. I have 
[asked](https://github.com/apache/incubator-xtable/pull/669#discussion_r2018802552)
 previously about ensuring the outputs align with the project's expectations 
but do not see enough tests to ensure that currently. When dealing with 
people's data it is very important to get the outputs right or else you end up 
with files being skipped due to improper column level statistics and therefore 
incorrect results in the output of your query engine. This is the reason for 
the high bar.
   
   Additionally, this feedback is almost identical to what we went through on 
the [schema 
conversion](https://github.com/apache/incubator-xtable/pull/669#discussion_r2040724521)
 where the test cases kept being removed by commenting them out instead of 
being additive. Instead of commenting out cases, you should always be expanding 
upon the initial test case you came up with to ensure any future changes do not 
break the initial set of cases you were handling. 



-- 
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-unsubscr...@xtable.apache.org

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

Reply via email to