voonhous commented on code in PR #19777:
URL: https://github.com/apache/hudi/pull/19777#discussion_r3891488284


##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchema.java:
##########
@@ -976,11 +976,26 @@ public static HoodieSchema.Vector createVector(String 
name, int dimension, Vecto
    *     |-- typed_value: <fieldType> (nullable)
    * </pre></p>
    *
+   * <p>The record is named after the shredded field, so a caller that 
generates it from a user
+   * schema has to put it in a namespace it owns, and one strictly below the 
variant's own. With a
+   * null namespace the struct's full name is the bare field name, which 
collides with a
+   * user-declared record type of that name; in the variant's own namespace a 
field spelled
+   * {@code typed_value} or {@code <column>_variant} collides with the 
generated records that sit
+   * there. Either collision breaks {@code Schema.toString()} -- what gets 
stamped into the parquet
+   * footer: on avro 1.11 it throws "Can't redefine" at file open, and on avro 
1.12 it emits the
+   * second definition as a bare reference to the first, i.e. writes a footer 
schema that parses
+   * back into something else. {@link #createVariantShreddedObject} therefore 
passes the full name
+   * of the enclosing {@code typed_value} record. A null namespace is fine for 
a caller with
+   * nothing to give -- a struct built standalone, as tests do, has no 
surrounding schema for the
+   * bare name to collide with; anything generating structs into a user schema 
owes them one.

Review Comment:
   Dropped. `createVariantShreddedObject(Map)` is gone; the 4-arg overload is 
the only one, its javadoc carries the example and says what a null namespace is 
for (a standalone variant with no surrounding schema). All 18 callers were 
tests and now pass `null, null, null` explicitly.
   



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