xndai commented on code in PR #17560:
URL: https://github.com/apache/iceberg/pull/17560#discussion_r3787762154
##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquetValueWriters.java:
##########
@@ -60,4 +68,144 @@ void geospatialValueSizeMetricsExcludeNulls() {
assertThat(metrics.nullValueCount()).isEqualTo(1);
assertThat(metrics.avgValueSizeInBytes()).isEqualTo(31);
}
+
+ @Test
+ void nullStructCountsNullsForOptionalNestedFields() {
+ // a null struct is also null for the optional fields it contains, but
those columns are written
Review Comment:
Fixed the wording.
##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquetValueWriters.java:
##########
@@ -60,4 +68,144 @@ void geospatialValueSizeMetricsExcludeNulls() {
assertThat(metrics.nullValueCount()).isEqualTo(1);
assertThat(metrics.avgValueSizeInBytes()).isEqualTo(31);
}
+
+ @Test
+ void nullStructCountsNullsForOptionalNestedFields() {
+ // a null struct is also null for the optional fields it contains, but
those columns are written
+ // by the struct's writer and never see the value, so the struct must
count the nulls for them
+ Types.StructType struct =
+ Types.StructType.of(
+ optional(2, "d", Types.DoubleType.get()), optional(3, "f",
Types.FloatType.get()));
Review Comment:
Done.
--
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]