the-other-tim-brown commented on code in PR #17526:
URL: https://github.com/apache/hudi/pull/17526#discussion_r2600601908
##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchemaUtils.java:
##########
@@ -386,4 +386,154 @@ private static Option<Pair<String, HoodieSchemaField>>
getNestedFieldInternal(Ho
));
}
}
+
+ /**
+ * Generates a projection schema from the original schema, including only
the specified fields.
+ * This is equivalent to HoodieAvroUtils.generateProjectionSchema() but
operates on HoodieSchema.
+ *
+ * @param originalSchema the source schema
+ * @param fieldNames the list of field names to include in the projection
+ * @return new HoodieSchema containing only the specified fields
+ * @throws IllegalArgumentException if schema is null or not a record type
+ * @since 1.2.0
+ */
+ public static HoodieSchema generateProjectionSchema(HoodieSchema
originalSchema, List<String> fieldNames) {
Review Comment:
True, right now we're just matching the signatures so the migration is easy
but I also do not like having too many static classes and methods so we should
revisit this.
--
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]