This is an automated email from the ASF dual-hosted git repository.

danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 256729a7c148 fix: throw exception instead of return original schema 
(#13885)
256729a7c148 is described below

commit 256729a7c148e68912bc3954465ef1f49d33cec2
Author: Jon Vexler <[email protected]>
AuthorDate: Fri Sep 12 01:28:21 2025 -0400

    fix: throw exception instead of return original schema (#13885)
    
    Co-authored-by: Jonathan Vexler <=>
---
 hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java 
b/hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java
index 8658d8f3960b..13425cf62a9c 100644
--- a/hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java
+++ b/hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java
@@ -1469,7 +1469,7 @@ public class HoodieAvroUtils {
     } else if (schema.getTypes().size() == 1) {
       actualSchema = schema.getTypes().get(0);
     } else if (data == null) {
-      return schema;
+      throw new HoodieAvroSchemaException("Union is malformed: " + schema);
     } else {
       // deal complex union. this should not happen in hoodie,
       // since flink/spark do not write this type.

Reply via email to