hudi-agent commented on code in PR #18893:
URL: https://github.com/apache/hudi/pull/18893#discussion_r3417996800


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/schema/SchemaProviderWithPostProcessor.java:
##########
@@ -38,20 +38,30 @@ public SchemaProviderWithPostProcessor(SchemaProvider 
schemaProvider,
     this.schemaPostProcessor = schemaPostProcessor;
   }
 
+  @Override
+  public HoodieSchema getSourceHoodieSchema() {

Review Comment:
   🤖 nit: `getSourceHoodieSchema` and `getTargetHoodieSchema` are structurally 
identical — could you extract a private `applyPostProcessor(HoodieSchema 
schema)` helper and reduce both to one-liners? e.g. `return 
applyPostProcessor(schemaProvider.getSourceHoodieSchema());`
   
   <sub><i>- AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/schema/SchemaRegistryProvider.java:
##########
@@ -321,7 +322,13 @@ public Schema getSourceSchema() {
   }
 
   @Override
-  public Schema getTargetSchema() {
+  @Deprecated
+  public Schema getSourceSchema() {
+    return getSourceHoodieSchema().toAvroSchema();
+  }
+
+  @Override
+  public HoodieSchema getTargetHoodieSchema() {

Review Comment:
   🤖 Unlike the other migrated providers, this class doesn't add a deprecated 
`getTargetSchema()` bridge. Since the original `getTargetSchema()` override is 
removed, legacy callers (e.g. `BootstrapExecutorUtils.java:156-157`) will fall 
through to the base implementation, which returns `getSourceSchema()` — 
silently returning the source schema instead of the target registry URL's 
schema. Could you add a `getTargetSchema()` override delegating to 
`getTargetHoodieSchema().toAvroSchema()`, matching what 
`FilebasedSchemaProvider` and `HiveSchemaProvider` do?
   
   <sub><i>- AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



-- 
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]

Reply via email to