nastra commented on code in PR #14262:
URL: https://github.com/apache/iceberg/pull/14262#discussion_r2416837488
##########
core/src/test/java/org/apache/iceberg/TestContentFileParser.java:
##########
@@ -161,6 +186,81 @@ private static String
dataFileJsonWithAllOptional(PartitionSpec spec) {
}
}
+ private static String dataFileJsonWithAllOptionalContentStats() {
+ return
"{\"spec-id\":0,\"content\":\"DATA\",\"file-path\":\"/path/to/data-with-stats.parquet\","
+ + "\"file-format\":\"PARQUET\","
+ + "\"partition\":{\"1000\":1},"
+ + "\"file-size-in-bytes\":350,"
+ + "\"record-count\":10,"
+ + "\"key-metadata\":\"00000000000000000000000000000000\","
+ + "\"split-offsets\":[128,256],"
+ + "\"sort-order-id\":1,"
+ + "\"content-stats\":{"
+ + "\"10200\":{"
+ + "\"10202\":90,"
+ + "\"10203\":10,"
+ + "\"10204\":0,"
+ + "\"10205\":1000000,"
+ + "\"10206\":5000000"
+ + "},"
+ + "\"10400\":{"
+ + "\"10402\":180,"
+ + "\"10403\":20,"
+ + "\"10404\":0,"
+ + "\"10405\":\"02000000\","
+ + "\"10406\":\"0A000000\""
+ + "}"
+ + "}"
+ + "}";
+ }
+
+ private static DataFile dataFileWithAllOptionalContentStats(PartitionSpec
spec) {
+ DataFiles.Builder builder =
+ DataFiles.builder(spec)
+ .withPath("/path/to/data-with-stats.parquet")
+ .withContentStats(
+ BaseContentStats.builder()
+ .withFieldStats(
+ BaseFieldStats.<Integer>builder()
+ .fieldId(1)
+ .type(Types.IntegerType.get())
+ .valueCount(90L)
+ .nullValueCount(10L)
+ .nanValueCount(0L)
+ .lowerBound(1000000)
+ .upperBound(5000000)
+ .build()
+ )
+ .withFieldStats(
+ BaseFieldStats.<String>builder()
+ .fieldId(2)
+ .type(Types.StringType.get())
+ .valueCount(180L)
+ .nullValueCount(20L)
+ .nanValueCount(0L)
+ .lowerBound("02000000")
+ .upperBound("0A000000")
+ .build()
+ )
Review Comment:
maybe also add field stats where only some fields are set
--
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]