voonhous commented on code in PR #19855:
URL: https://github.com/apache/hudi/pull/19855#discussion_r3965114079
##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchemaRepair.java:
##########
@@ -40,7 +40,7 @@
*
* <p>{@link #hasTimestampMillisField(HoodieSchema)} is the cheap pre-check
used to decide whether the
* repair is worth wiring in at all. Its sibling in the metadata-table domain
is
- * {@code HoodieTableMetadataUtil#isTimestampMillisField}, which answers the
same question for one field
+ * {@code HoodieSchemaUtils#isTimestampMillisField}, which answers the same
question for one field
Review Comment:
Addressed in ebaa63ff -- the sentence now reads "Its per-field sibling is
`HoodieSchemaUtils#isTimestampMillisField`".
##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchemaUtils.java:
##########
@@ -520,6 +520,49 @@ public static HoodieSchema
generateProjectionSchema(HoodieSchema originalSchema,
return HoodieSchema.createRecord(originalSchema.getName(),
originalSchema.getNamespace().orElse(null),
originalSchema.getDoc().orElse(null), projectedFields);
}
+ /**
+ * Generate a reader schema off the provided writeSchema, to just project
out the provided columns.
+ *
+ * <p>This overload is intended for callers that already have a
name-to-field map,
+ * such as the realtime reader.</p>
+ *
+ * @param writeSchema the source schema
+ * @param schemaFieldsMap prebuilt case-insensitive field-name map
+ * @param fieldNames the list of field names to include in the
projection
+ * @return new HoodieSchema containing only the specified fields
+ */
+ public static HoodieSchema generateProjectionSchema(HoodieSchema writeSchema,
+ Map<String,
HoodieSchemaField> schemaFieldsMap,
+ List<String> fieldNames)
{
+ ValidationUtils.checkArgument(writeSchema != null, "Write schema cannot be
null");
+ ValidationUtils.checkArgument(schemaFieldsMap != null, "Schema fields map
cannot be null");
+ ValidationUtils.checkArgument(fieldNames != null, "Field names cannot be
null");
+
+ /**
Review Comment:
Addressed in 16ffe61e -- switched to a plain `/* ... */` block.
--
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]