hudi icon indicating copy to clipboard operation
hudi copied to clipboard

[SUPPORT] java.lang.NoSuchMethodError: org.apache.hudi.common.table.TableSchemaResolver.getTableAvroSchema(Z)Lorg/apache/avro/Schema;

Open dwshmilyss opened this issue 4 years ago • 4 comments

When I tried to add an index to a cow table by async in schedule stage,i got this error:

3229 [main] ERROR org.apache.hudi.utilities.UtilHelpers  - Indexer failed
java.lang.NoSuchMethodError: org.apache.hudi.common.table.TableSchemaResolver.getTableAvroSchema(Z)Lorg/apache/avro/Schema;
	at org.apache.hudi.utilities.UtilHelpers.getSchemaFromLatestInstant(UtilHelpers.java:554)
	at org.apache.hudi.utilities.HoodieIndexer.scheduleIndexing(HoodieIndexer.java:223)
	at org.apache.hudi.utilities.HoodieIndexer.lambda$start$1(HoodieIndexer.java:190)
	at org.apache.hudi.utilities.UtilHelpers.retry(UtilHelpers.java:541)
	at org.apache.hudi.utilities.HoodieIndexer.start(HoodieIndexer.java:186)
	at org.apache.hudi.utilities.HoodieIndexer.main(HoodieIndexer.java:155)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
	at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:955)
	at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)
	at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)
	at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)
	at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1043)
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1052)
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

but i checked hudi-utilities-bundle_2.12-0.11.1.jar , and i found out this method was exists。 image Please help me , I would appreciate it.

dwshmilyss avatar Nov 22 '22 10:11 dwshmilyss

@dwshmilyss how did you run the job? would need to know the spark submit job with classpath info

and hudi/spark version info

xushiyan avatar Nov 22 '22 11:11 xushiyan

oh , my mistake. spark:3.2.2 hudi:0.11.1 and my command was:

spark-submit \
--class org.apache.hudi.utilities.HoodieIndexer \
/hudi-utilities-bundle_2.11-0.12.0-SNAPSHOT.jar \
--props /indexer.properties \
--mode schedule \
--base-path myhdfs://hudi_table\
--table-name hudi_table \
--index-types COLUMN_STATS \
--parallelism 1 \
--spark-memory 1g

i put hudi-spark3-boundle.jar and hudi-hadoop-mr-boundle.jar on spark jars directory @xushiyan

dwshmilyss avatar Nov 22 '22 12:11 dwshmilyss

the jar you're using hudi-utilities-bundle_2.11-0.12.0-SNAPSHOT.jar is a) not hudi 0.11.1 as you claimed; it says 0.12.0-SNAPSHOT (not even a release jar) b) this jar is meant for spark 2.4 with scala 2.11, which is not spark 3.2.2 with scala12 as you claimed

you're using spark 3.2 so you should use hudi-utilities-slim-bundle_2.12 and hudi-spark3.2-bundle_2.12

pls read through release notes on bundle update

  • https://hudi.apache.org/releases/release-0.12.0#bundle-updates
  • https://hudi.apache.org/releases/release-0.11.0#bundle-usage-updates

also read through readme of the project and see which bundle matches your spark version. and you don't need hadoop-mr-bundle as you're not making hive query.

cc @bhasudha how can we improve docs for this scenario for bundle usage? can we file a task as part of https://github.com/apache/hudi/pull/6902 ?

xushiyan avatar Nov 22 '22 15:11 xushiyan

@xushiyan The cause of the problem is jar conflicts. It can't put hadoop-mr-bundles in the jars directory of spark, which causes conflicts,I think some classes are colliding in hadoop-mr-boundle and hudi-utilities-bundle。thanks a lot for you help!!!

dwshmilyss avatar Nov 23 '22 02:11 dwshmilyss