huaxiangsun commented on code in PR #12771:
URL: https://github.com/apache/iceberg/pull/12771#discussion_r2045745717


##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquet.java:
##########
@@ -219,6 +221,50 @@ public void testTwoLevelList() throws IOException {
     assertThat(recordRead.get("topbytes")).isEqualTo(expectedBinary);
   }
 
+  @Test
+  public void testColumnStatisticsEnabled() throws Exception {
+    Schema schema =
+        new Schema(
+            optional(1, "int_field", IntegerType.get()),
+            optional(2, "string_field", Types.StringType.get()));
+
+    File file = createTempFile(temp);
+
+    List<GenericData.Record> records = Lists.newArrayListWithCapacity(5);
+    org.apache.avro.Schema avroSchema = 
AvroSchemaUtil.convert(schema.asStruct());
+    for (int i = 1; i <= 5; i++) {
+      GenericData.Record record = new GenericData.Record(avroSchema);
+      record.put("int_field", i);
+      record.put("string_field", "test");
+      records.add(record);
+    }
+
+    write(
+        file,
+        schema,
+        ImmutableMap.<String, String>builder()
+            .put(PARQUET_COLUMN_STATS_ENABLED_PREFIX + "int_field", "true")

Review Comment:
   Yeah, the default behavior is true for now. If it is configured to false, it 
will not work as Huaxin mentioned. I can create a PR to add test coverage.



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to