lucasmo opened a new issue, #11602: URL: https://github.com/apache/hudi/issues/11602
**Describe the problem you faced** When diagnosing a problem with XTable (see https://github.com/apache/incubator-xtable/issues/466), I noticed that avro classes were unable to even be instantiated for schema in a very simple test case when using `hudi-common-0.14.0` as a dependency. However, this issue does not exist when using `hudi-spark3.4-bundle_2.12-0.14.0` as a dependency, which contains the same avro autogenerated classes. A good specific example is `org/apache/hudi/avro/model/HoodieCleanPartitionMetadata.class`. When compiling hudi locally (tag `release-0.14.0`, `mvn clean package -DskipTests -Dspark3.4`, java 1.8), both generated jar files have the correct implementations of avro autogenerated classes. **To Reproduce** Steps to reproduce the behavior: 1. Download and uncompress hudi-spark3.4-bundle_2.12-0.14.0.jar and hudi-common-0.14.0.jar from mavencentral 2. Build Hudi locally 3. Run javap on `org/apache/hudi/avro/model/HoodieCleanPartitionMetadata.class` in all four of the jars 4. Note the file size of the text output of javap is 4232 for the file from every single jar aside from hudi-common, which has a javap text file size of 2323. OR run the following in Java 11, replacing $PATH_TO_A_HOODIE_AVRO_MODELS_JAR with a path to one of the four jar files ``` jshell --class-path ~/.m2/repository/org/apache/avro/avro/1.11.3/avro-1.11.3.jar:~/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.17.1/jackson-core-2.17.1.jar:~/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.17.1/jackson-databind-2.17.1.jar:~/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.17.1/jackson-annotations-2.17.1.jar:~/.m2/repository/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:$PATH_TO_A_HOODIE_AVRO_MODELS_JAR ``` Then, copy and paste this into the shell: ``` org.apache.avro.Schema schema = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"HoodieCleanPartitionMetadata\",\"namespace\":\"org.apache.hudi.avro.model\",\"fields\":[{\"name\":\"partitionPath\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"policy\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"deletePathPatterns\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}},{\"name\":\"successDeleteFiles\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}},{\"name\":\"failedDeleteFiles\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}},{\"name\":\"isPartitionDeleted\",\"type\":[\"null\",\"boolean\"],\"default\":null}]}"); System.out.println("Class for schema: " + org.apache.avro.specific.SpecificData.get().getClass(schema)); ``` On the MavenCentral hudi-common-0.14.0 jar, you should get: ``` | Exception java.lang.ExceptionInInitializerError | at Class.forName0 (Native Method) | at Class.forName (Class.java:398) ... | Caused by: java.lang.IllegalStateException: Recursive update | at ConcurrentHashMap.computeIfAbsent (ConcurrentHashMap.java:1760) ``` **Expected behavior** The above code snippet prints ``` Class for schema: class org.apache.hudi.avro.model.HoodieCleanPartitionMetadata ``` **Environment Description** * Hudi version : 0.14.0 everything else n/a, but duplicated issue on macOS and Ubuntu 22.04. -- 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]
