rdblue commented on code in PR #18109:
URL: https://github.com/apache/iceberg/pull/18109#discussion_r4031380795
##########
core/src/main/java/org/apache/iceberg/TrackedFile.java:
##########
@@ -131,6 +127,24 @@ private static Type typeOrUnknown(Types.StructType
structType) {
return structType.fields().isEmpty() ? Types.UnknownType.get() :
structType;
}
+ /**
+ * Returns the schema for the given partition and content stats types.
+ *
+ * <p>The partition and content stats fields use {@link Types.UnknownType}
when their types have
+ * no fields, so that they are not stored in manifest files.
+ */
+ static Schema schema(Types.StructType partitionType, Types.StructType
contentStatsType) {
+ return new Schema(fields(partitionType, contentStatsType));
+ }
+
+ static Schema readSchema(Types.StructType partitionType, Types.StructType
contentStatsType) {
+ List<Types.NestedField> nonEmptyFields =
+ fields(partitionType, contentStatsType).stream()
+ .filter(field -> field.type().typeId() != Type.TypeID.UNKNOWN)
Review Comment:
Yes, only partition and content type will be filtered here.
--
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]